Add in configmap for KUD variables to bpa-operator 88/4188/4
authorEric Adams <eric.adams@intel.com>
Wed, 31 Mar 2021 00:26:50 +0000 (00:26 +0000)
committerKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Mon, 24 May 2021 17:00:17 +0000 (17:00 +0000)
Signed-off-by: Eric Adams <eric.adams@intel.com>
Change-Id: I296c24875138ea3c2a3b90688dd097c2abca608a

cmd/bpa-operator/Makefile
cmd/bpa-operator/deploy/kud-installer.yaml [new file with mode: 0644]
cmd/bpa-operator/pkg/controller/provisioning/provisioning_controller.go

index a34522f..f075b9a 100644 (file)
@@ -38,6 +38,7 @@ deploy:
        kubectl apply -f deploy/role_binding.yaml
        kubectl apply -f deploy/crds/provisioning-crd/bpa_v1alpha1_provisioning_crd.yaml
        kubectl apply -f deploy/crds/software-crd/bpa_v1alpha1_software_crd.yaml
+       kubectl apply -f deploy/kud-installer.yaml
        kubectl apply -f deploy/operator.yaml
        kubectl create secret generic ssh-key-secret --from-file=id_rsa=/root/.ssh/id_rsa --from-file=id_rsa.pub=/root/.ssh/id_rsa.pub
 
@@ -48,6 +49,7 @@ delete:
        kubectl delete -f deploy/role_binding.yaml
        kubectl delete -f deploy/crds/provisioning-crd/bpa_v1alpha1_provisioning_crd.yaml
        kubectl delete -f deploy/crds/software-crd/bpa_v1alpha1_software_crd.yaml
+       kubectl delete -f deploy/kud-installer.yaml
        kubectl delete -f deploy/operator.yaml
        kubectl delete secret ssh-key-secret
 
diff --git a/cmd/bpa-operator/deploy/kud-installer.yaml b/cmd/bpa-operator/deploy/kud-installer.yaml
new file mode 100644 (file)
index 0000000..cbeafa4
--- /dev/null
@@ -0,0 +1,28 @@
+---
+#  Copyright 2021 Intel Corporation, Inc
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: kud-installer
+data:
+  #Choose either docker or containerd for the CONTAINER_RUNTIME
+  CONTAINER_RUNTIME: "docker"
+  KUD_DEBUG: ""
+  KUD_ENABLE_TESTS: "true"
+  #Kata webhook will only be enabled if containerd is used
+  ENABLE_KATA_WEBHOOK: "false"
+  #Chose either "kata-qemu" or "kata-clh" for the Kata webhook runtimeclass
+  KATA_WEBHOOK_RUNTIMECLASS: "kata-clh"
index cc00afb..da0c18d 100644 (file)
@@ -678,6 +678,11 @@ func createKUDinstallerJob(clusterName, namespace string, labels map[string]stri
                                                         },
 
                                            },
+                                           EnvFrom: []corev1.EnvFromSource{
+                                                   {
+                                                             ConfigMapRef: &corev1.ConfigMapEnvSource{LocalObjectReference: corev1.LocalObjectReference{Name: "kud-installer"}},
+                                                   },
+                                           },
                                            Command: []string{"/bin/sh","-c"},
                                            Args: []string{"cp -r /.ssh /root/; chmod -R 600 /root/.ssh;" + installerString},
                                            SecurityContext: &corev1.SecurityContext{