aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-minimal-onap
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2019-12-09 16:16:48 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2019-12-18 07:31:39 +0000
commit0664ac4023cd0b96d002c8515ee5767417bab6e1 (patch)
treea5f91d77bb00d59e9cb2fac19cd3d391d33b9fee /bootstrap/vagrant-minimal-onap
parent3cb78218ec4e5cb6ab9aae6987b7c03f22d588e3 (diff)
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 <p.wieczorek2@samsung.com>
Diffstat (limited to 'bootstrap/vagrant-minimal-onap')
-rw-r--r--bootstrap/vagrant-minimal-onap/Vagrantfile27
1 files changed, 27 insertions, 0 deletions
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