From 80e1d68fa0c39bfb07b7ecb24cb8288302362a48 Mon Sep 17 00:00:00 2001 From: intlabs Date: Sun, 12 Nov 2017 01:18:06 -0600 Subject: [PATCH] Gate: Move to k8s v1.8.3 and expose params This PS moves to use version 1.8.3 of k8s and also exposes all the versions as build params to the kubeadm-aio dockerfile. Change-Id: I8e6ef8090f3fa178e950a42605a5d86e298e0c99 --- .../tasks/setup-helm-serve.yaml | 4 ++-- .../build-images/tasks/kubeadm-aio.yaml | 5 +++++ tools/gate/playbooks/vars.yaml | 7 +++++-- tools/image-repo-overides.sh | 2 +- tools/images/kubeadm-aio/Dockerfile | 20 +++++++++++++------ 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/tools/gate/playbooks/build-helm-packages/tasks/setup-helm-serve.yaml b/tools/gate/playbooks/build-helm-packages/tasks/setup-helm-serve.yaml index ff1a65ea6..899524ded 100644 --- a/tools/gate/playbooks/build-helm-packages/tasks/setup-helm-serve.yaml +++ b/tools/gate/playbooks/build-helm-packages/tasks/setup-helm-serve.yaml @@ -14,7 +14,7 @@ - name: check if correct version of helm client already installed shell: "[ \"x$($(type -p helm) version --client --short | awk '{ print $NF }' | awk -F '+' '{ print $1 }')\" == \"x${HELM_VERSION}\" ] || exit 1" environment: - HELM_VERSION: "{{ helm.version }}" + HELM_VERSION: "{{ version.helm }}" register: need_helm ignore_errors: True - name: install helm client @@ -22,7 +22,7 @@ become_user: root shell: | TMP_DIR=$(mktemp -d) - curl -sSL https://storage.googleapis.com/kubernetes-helm/helm-{{ helm.version }}-linux-amd64.tar.gz | tar -zxv --strip-components=1 -C ${TMP_DIR} + curl -sSL https://storage.googleapis.com/kubernetes-helm/helm-{{ version.helm }}-linux-amd64.tar.gz | tar -zxv --strip-components=1 -C ${TMP_DIR} sudo mv ${TMP_DIR}/helm /usr/bin/helm rm -rf ${TMP_DIR} - name: setting up helm client diff --git a/tools/gate/playbooks/build-images/tasks/kubeadm-aio.yaml b/tools/gate/playbooks/build-images/tasks/kubeadm-aio.yaml index 8cc2f9459..c7e4257af 100644 --- a/tools/gate/playbooks/build-images/tasks/kubeadm-aio.yaml +++ b/tools/gate/playbooks/build-images/tasks/kubeadm-aio.yaml @@ -21,3 +21,8 @@ pull: yes state: present rm: yes + buildargs: + KUBE_VERSION: "{{ version.kubernetes }}" + CNI_VERSION: "{{ version.cni }}" + HELM_VERSION: "{{ version.helm }}" + CHARTS: "calico,flannel,tiller,kube-dns" diff --git a/tools/gate/playbooks/vars.yaml b/tools/gate/playbooks/vars.yaml index f18e69f86..7ec82ea18 100644 --- a/tools/gate/playbooks/vars.yaml +++ b/tools/gate/playbooks/vars.yaml @@ -12,12 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +version: + kubernetes: v1.8.3 + helm: v2.7.0 + cni: v0.6.0 + images: kubernetes: kubeadm_aio: openstackhelm/kubeadm-aio:dev -helm: - version: v2.7.0 kubernetes: network: diff --git a/tools/image-repo-overides.sh b/tools/image-repo-overides.sh index 4dce081d1..a62164f70 100755 --- a/tools/image-repo-overides.sh +++ b/tools/image-repo-overides.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -KUBE_VERSION=v1.8.2 +KUBE_VERSION=$(yq -r '.version.kubernetes' ./tools/gate/playbooks/vars.yaml) KUBE_IMAGES="gcr.io/google_containers/hyperkube-amd64:${KUBE_VERSION} gcr.io/google_containers/kube-apiserver-amd64:${KUBE_VERSION} gcr.io/google_containers/kube-controller-manager-amd64:${KUBE_VERSION} diff --git a/tools/images/kubeadm-aio/Dockerfile b/tools/images/kubeadm-aio/Dockerfile index f06af92b6..d8bd08e1e 100644 --- a/tools/images/kubeadm-aio/Dockerfile +++ b/tools/images/kubeadm-aio/Dockerfile @@ -16,13 +16,21 @@ FROM gcr.io/google_containers/ubuntu-slim:0.14 MAINTAINER pete.birley@att.com -ENV KUBE_VERSION="v1.8.2" \ - CNI_VERSION="v0.6.0" \ - HELM_VERSION="v2.7.0" \ - container="docker" \ +ARG KUBE_VERSION="v1.8.3" +ENV KUBE_VERSION ${KUBE_VERSION} + +ARG CNI_VERSION="v0.6.0" +ENV CNI_VERSION ${CNI_VERSION} + +ARG HELM_VERSION="v2.7.0" +ENV HELM_VERSION ${HELM_VERSION} + +ARG CHARTS="calico,flannel,tiller,kube-dns" +ENV CHARTS ${CHARTS} + +ENV container="docker" \ DEBIAN_FRONTEND="noninteractive" \ - CNI_BIN_DIR="/opt/cni/bin" \ - CHARTS="calico,flannel,tiller,kube-dns" + CNI_BIN_DIR="/opt/cni/bin" RUN set -ex ;\ apt-get update ;\