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}" <