From: Eric Adams Date: Wed, 31 Mar 2021 00:26:50 +0000 (+0000) Subject: Add in configmap for KUD variables to bpa-operator X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F88%2F4188%2F4;p=icn.git Add in configmap for KUD variables to bpa-operator Signed-off-by: Eric Adams Change-Id: I296c24875138ea3c2a3b90688dd097c2abca608a --- diff --git a/cmd/bpa-operator/Makefile b/cmd/bpa-operator/Makefile index a34522f..f075b9a 100644 --- a/cmd/bpa-operator/Makefile +++ b/cmd/bpa-operator/Makefile @@ -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 index 0000000..cbeafa4 --- /dev/null +++ b/cmd/bpa-operator/deploy/kud-installer.yaml @@ -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" diff --git a/cmd/bpa-operator/pkg/controller/provisioning/provisioning_controller.go b/cmd/bpa-operator/pkg/controller/provisioning/provisioning_controller.go index cc00afb..da0c18d 100644 --- a/cmd/bpa-operator/pkg/controller/provisioning/provisioning_controller.go +++ b/cmd/bpa-operator/pkg/controller/provisioning/provisioning_controller.go @@ -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{