From 957bcb15a474b8e62b626dd7296c2adad189024c Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Mon, 19 Nov 2018 11:50:36 -0600 Subject: [PATCH] Gate: minikube single node gate deployment This PS moves the single node gate to use a lightwight minikube based env. Change-Id: I285c4222795b66f3527f0daaf62a91973da5dca8 Co-authored-by: Krishna Venkata Signed-off-by: Pete Birley --- tools/deployment/common/005-deploy-k8s.sh | 143 +++++++++++++++++++++- 1 file changed, 141 insertions(+), 2 deletions(-) diff --git a/tools/deployment/common/005-deploy-k8s.sh b/tools/deployment/common/005-deploy-k8s.sh index b0a3e8cc8..60a156099 100755 --- a/tools/deployment/common/005-deploy-k8s.sh +++ b/tools/deployment/common/005-deploy-k8s.sh @@ -15,6 +15,145 @@ # under the License. set -xe +: ${HELM_VERSION:="v2.11.0"} +: ${KUBE_VERSION:="v1.12.2"} +: ${MINIKUBE_VERSION:="v0.30.0"} +: ${CALICO_VERSION:="v3.3"} +export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true -make dev-deploy setup-host -make dev-deploy k8s +# NOTE: Clean Up hosts file +sudo sed -i '/^127.0.0.1/c\127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' /etc/hosts +sudo sed -i '/^::1/c\::1 localhost6 localhost6.localdomain6' /etc/hosts + +# NOTE: Install required packages on host +sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 460F3994 +RELEASE_NAME=$(grep 'CODENAME' /etc/lsb-release | awk -F= '{print $2}') +sudo add-apt-repository "deb https://download.ceph.com/debian-luminous/ ${RELEASE_NAME} main" +sudo -E apt-get update +sudo -E apt-get install -y \ + docker.io \ + socat \ + jq \ + util-linux \ + ceph-common \ + rbd-nbd \ + nfs-common \ + bridge-utils \ + libxtables11 +sudo -E tee /etc/modprobe.d/rbd.conf <&1) +Restart=always +ExecStart=/usr/local/bin/helm serve + +[Install] +WantedBy=multi-user.target +EOF + +sudo chmod 0640 /etc/systemd/system/helm-serve.service +sudo systemctl restart helm-serve +sudo systemctl daemon-reload +sudo systemctl enable helm-serve + + +# NOTE: Set up local helm repo +helm repo add local http://localhost:8879/charts +helm repo update +uptime +make + + +# NOTE: Set required labels on host(s) +kubectl label nodes --all openstack-control-plane=enabled +kubectl label nodes --all openstack-compute-node=enabled +kubectl label nodes --all openvswitch=enabled +kubectl label nodes --all linuxbridge=enabled +kubectl label nodes --all ceph-mon=enabled +kubectl label nodes --all ceph-osd=enabled +kubectl label nodes --all ceph-mds=enabled +kubectl label nodes --all ceph-rgw=enabled +kubectl label nodes --all ceph-mgr=enabled + + +# NOTE: Setup resolv.conf to use the k8s api server, which is required for the +# kubelet to resolve cluster services. +sudo -E rm -rf /etc/resolv.conf +sudo -E tee /etc/resolv.conf <