From 21ada44f59c6d119d832e511dca1e90e7e27ff0f Mon Sep 17 00:00:00 2001 From: Gage Hugo Date: Mon, 30 Aug 2021 18:58:47 -0500 Subject: [PATCH] Add base helm3 job This change adds a new script and job to deploy minikube with helm3. This job will be improved upon in later changes as part of the movement to helm3. Change-Id: Ia7ef30a4e2af77508ad95191e5241d2c1b83a7c4 --- playbooks/osh-infra-gate-runner.yaml | 3 + tools/gate/deploy-k8s.sh | 237 +++++++++++++++++++++++++++ zuul.d/jobs.yaml | 15 ++ zuul.d/project.yaml | 1 + 4 files changed, 256 insertions(+) create mode 100755 tools/gate/deploy-k8s.sh diff --git a/playbooks/osh-infra-gate-runner.yaml b/playbooks/osh-infra-gate-runner.yaml index 69fa89735..cecd684a4 100644 --- a/playbooks/osh-infra-gate-runner.yaml +++ b/playbooks/osh-infra-gate-runner.yaml @@ -16,6 +16,9 @@ - name: Ensure pip include_role: name: ensure-pip + - name: Clear firewall + include_role: + name: clear-firewall - name: Override images include_role: name: override-images diff --git a/tools/gate/deploy-k8s.sh b/tools/gate/deploy-k8s.sh new file mode 100755 index 000000000..549a32376 --- /dev/null +++ b/tools/gate/deploy-k8s.sh @@ -0,0 +1,237 @@ +#!/bin/bash +# 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 a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + +: "${HELM_VERSION:="v3.6.3"}" +: "${KUBE_VERSION:="v1.22.0"}" +: "${MINIKUBE_VERSION:="v1.22.0"}" +: "${CALICO_VERSION:="v3.20"}" +: "${YQ_VERSION:="v4.6.0"}" + +: "${HTTP_PROXY:=""}" +: "${HTTPS_PROXY:=""}" +: "${NO_PROXY:=""}" + +export DEBCONF_NONINTERACTIVE_SEEN=true +export DEBIAN_FRONTEND=noninteractive + +sudo swapoff -a + +# Note: Including fix from https://review.opendev.org/c/openstack/openstack-helm-infra/+/763619/ +echo "DefaultLimitMEMLOCK=16384" | sudo tee -a /etc/systemd/system.conf +sudo systemctl daemon-reexec + +# Function to help generate a resolv.conf formatted file. +# Arguments are positional: +# 1st is location of file to be generated +# 2nd is a custom nameserver that should be used exclusively if avalible. +function generate_resolvconf() { + local target + target="${1}" + local priority_nameserver + priority_nameserver="${2}" + if [[ ${priority_nameserver} ]]; then + sudo -E tee "${target}" <