From ac91f0cf96735f16d3d50f2dc85cbae97832d394 Mon Sep 17 00:00:00 2001 From: Drew Walters Date: Tue, 4 Dec 2018 21:54:56 +0000 Subject: [PATCH] airskiff: Use Minikube for Kubernetes deployment This commit replaces the kubeadm Kubernetes deployment script with the new OpenStack-Helm infra minikube deployment script. [0] https://review.openstack.org/618785 Change-Id: I36c7637a983308891914db7a1cac0907e2724712 --- doc/source/airskiff.rst | 14 +++++++------- tools/deployment/airskiff/common/setup-proxy.sh | 15 --------------- .../airskiff/developer/000-install-packages.sh | 1 + .../airskiff/developer/010-deploy-k8s.sh | 13 ++++++------- tools/gate/playbooks/airskiff-deploy-gate.yaml | 2 +- 5 files changed, 15 insertions(+), 30 deletions(-) diff --git a/doc/source/airskiff.rst b/doc/source/airskiff.rst index 506ffb152..a2832d062 100644 --- a/doc/source/airskiff.rst +++ b/doc/source/airskiff.rst @@ -21,7 +21,7 @@ Airskiff is packaged with a set of deployment scripts modeled after the These scripts: * Download, build, and containerize the Airship components above from source. -* Deploy a Kubernetes cluster using KubeADM. +* Deploy a Kubernetes cluster using Minikube. * Deploy Armada, Deckhand, and Shipyard using the latest `Armada image`_. * Deploy OpenStack using the Airskiff site and charts from the `OpenStack-Helm project`_. @@ -59,13 +59,13 @@ environment variables: export USE_PROXY=true export PROXY=${http_proxy} - export no_proxy=${no_proxy},172.17.0.1,.svc.cluster.local - export NO_PROXY=${NO_PROXY},172.17.0.1,.svc.cluster.local + export no_proxy=${no_proxy},10.0.2.15,.svc.cluster.local + export NO_PROXY=${NO_PROXY},10.0.2.15,.svc.cluster.local .. note:: The ``.svc.cluster.local`` address is required to allow the OpenStack client to communicate without being routed through proxy servers. The IP - address ``172.17.0.1`` is the advertised IP address for the Kubernetes API - server. Replace the addresses if your configuration does not match the one + address ``10.0.2.15`` is the advertised IP address of the minikube Kubernetes + cluster. Replace the addresses if your configuration does not match the one defined above. Deploy Airskiff @@ -110,8 +110,8 @@ Alternatively, this step can be performed by running the script directly: ./tools/deployment/airskiff/developer/005-clone-dependencies.sh -Deploy Kubernetes with KubeADM -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Deploy Kubernetes with Minikube +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. literalinclude:: ../../tools/deployment/airskiff/developer/010-deploy-k8s.sh :language: shell diff --git a/tools/deployment/airskiff/common/setup-proxy.sh b/tools/deployment/airskiff/common/setup-proxy.sh index 373d70b81..9823e551d 100755 --- a/tools/deployment/airskiff/common/setup-proxy.sh +++ b/tools/deployment/airskiff/common/setup-proxy.sh @@ -28,19 +28,4 @@ sed -i -e "/\s type:/a\ proxy_server: ${PROXY}" \ sed -i -e "/type: git/a\ proxy_server: ${PROXY}" \ tools/deployment/airskiff/manifests/airship.yaml -# Configure OpenStack-Helm proxy variables -cd ${INSTALL_PATH} -tee -a openstack-helm-infra/tools/gate/devel/local-vars.yaml << EOF -proxy: - http: ${PROXY} - https: ${PROXY} - noproxy: localhost,127.0.0.1,172.17.0.1,.svc.cluster.local -EOF - -# Add DNS nameservers present in /etc/resolv.conf to OSH playbook vars -sed -ne "s/nameserver //p" /etc/resolv.conf | while read -r ns; do - sed -i -e "/external_dns_nameservers:/ a\ - ${ns}" \ - openstack-helm-infra/tools/images/kubeadm-aio/assets/opt/playbooks/vars.yaml -done - cd "${CURRENT_DIR}" diff --git a/tools/deployment/airskiff/developer/000-install-packages.sh b/tools/deployment/airskiff/developer/000-install-packages.sh index 0f31ecfdb..72ee2f48e 100755 --- a/tools/deployment/airskiff/developer/000-install-packages.sh +++ b/tools/deployment/airskiff/developer/000-install-packages.sh @@ -26,6 +26,7 @@ sudo apt-get install --no-install-recommends -y \ jq \ nmap \ curl \ + python-pip \ uuid-runtime \ apt-transport-https \ ca-certificates \ diff --git a/tools/deployment/airskiff/developer/010-deploy-k8s.sh b/tools/deployment/airskiff/developer/010-deploy-k8s.sh index 409da2b17..dc0ccb3ad 100755 --- a/tools/deployment/airskiff/developer/010-deploy-k8s.sh +++ b/tools/deployment/airskiff/developer/010-deploy-k8s.sh @@ -1,7 +1,6 @@ #!/bin/bash -# Copyright 2017 The Openstack-Helm Authors. -# Copyright 2018 AT&T Intellectual Property. All other rights reserved. +# Copyright 2019, AT&T Intellectual Property # # 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 @@ -25,10 +24,10 @@ if [ -n "${PROXY}" ]; then . tools/deployment/airskiff/common/setup-proxy.sh fi -# Deploy a kubeadm-administered cluster. -cd ${OSH_INFRA_PATH} -make dev-deploy setup-host -make dev-deploy k8s -cd "${CURRENT_DIR}" +# Deploy K8s with Minikube +cd "${OSH_INFRA_PATH}" +bash -c "./tools/deployment/common/005-deploy-k8s.sh" kubectl label nodes --all --overwrite ucp-control-plane=enabled + +cd "${CURRENT_DIR}" diff --git a/tools/gate/playbooks/airskiff-deploy-gate.yaml b/tools/gate/playbooks/airskiff-deploy-gate.yaml index 3ed296fe8..1b9560533 100644 --- a/tools/gate/playbooks/airskiff-deploy-gate.yaml +++ b/tools/gate/playbooks/airskiff-deploy-gate.yaml @@ -21,7 +21,7 @@ chdir: "{{ zuul.project.src_dir }}" become: yes - - name: Deploy Kubernetes with KubeADM + - name: Deploy Kubernetes with Minikube shell: | ./tools/deployment/airskiff/developer/010-deploy-k8s.sh args: