From 0664ac4023cd0b96d002c8515ee5767417bab6e1 Mon Sep 17 00:00:00 2001 From: Pawel Wieczorek Date: Mon, 9 Dec 2019 16:16:48 +0100 Subject: Prepare cluster for helm-based deployments This patch adds missing client tools ("make" for helm charts generation on operator's machine) as well as the server side: local helm repo and K8s service account. Issue-ID: ONAPARC-537 Change-Id: I34bd5c9422dd1a5be0a1f235be3ee9598cc988c0 Signed-off-by: Pawel Wieczorek --- bootstrap/vagrant-minimal-onap/Vagrantfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/bootstrap/vagrant-minimal-onap/Vagrantfile b/bootstrap/vagrant-minimal-onap/Vagrantfile index 78668dfc3..df9ddad9c 100644 --- a/bootstrap/vagrant-minimal-onap/Vagrantfile +++ b/bootstrap/vagrant-minimal-onap/Vagrantfile @@ -66,6 +66,12 @@ $install_sshpass = <<-SCRIPT apt-get install sshpass SCRIPT +$install_make = <<-SCRIPT + apt-get update + echo "Installing 'make'" + apt-get install make +SCRIPT + $generate_key = <<-SCRIPT KEY_FILE="$1" echo "Generating SSH key (${KEY_FILE})" @@ -113,6 +119,24 @@ SCRIPT $get_helm_plugins = "cp -R ${HOME}/oom/kubernetes/helm/plugins/ ${HOME}/.helm" +$setup_helm_cluster = <<-SCRIPT + export KUBECONFIG="${HOME}/.kube/config.onap" + kubectl config use-context onap + kubectl -n kube-system create serviceaccount tiller + kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount=kube-system:tiller + helm init --service-account tiller + kubectl -n kube-system rollout status deploy/tiller-deploy +SCRIPT + +# FIXME: replace sleep command with helm repo readiness probe +$setup_helm_repo = <<-SCRIPT + helm serve & + sleep 3 + helm repo add local http://127.0.0.1:8879 + make -C ${HOME}/oom/kubernetes all + make -C ${HOME}/oom/kubernetes onap +SCRIPT + Vagrant.configure('2') do |config| all.each do |machine| config.vm.define machine[:name] do |config| @@ -202,6 +226,9 @@ Vagrant.configure('2') do |config| config.vm.provision "get_helm", type: :shell, path: "tools/get_helm.sh" config.vm.provision "get_oom", type: :shell, privileged: false, inline: $get_oom config.vm.provision "get_helm_plugins", type: :shell, privileged: false, inline: $get_helm_plugins + config.vm.provision "install_make", type: :shell, inline: $install_make + config.vm.provision "setup_helm_cluster", type: :shell, run: "never", privileged: false, inline: $setup_helm_cluster + config.vm.provision "setup_helm_repo", type: :shell, run: "never", privileged: false, inline: $setup_helm_repo end end end -- cgit 1.2.3-korg