|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# Copyright 2026 The Kubernetes Authors. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +# Like upgrade-ab, but on a gossip cluster — exercises hybrid worker bootstrap (#18245). |
| 18 | + |
| 19 | +REPO_ROOT=$(git rev-parse --show-toplevel); |
| 20 | + |
| 21 | +# k8s.local suffix triggers gossip mode across all clouds. |
| 22 | +export KOPS_DNS_DOMAIN="${KOPS_DNS_DOMAIN:-k8s.local}" |
| 23 | +if [[ "${KOPS_DNS_DOMAIN}" != "k8s.local" && "${KOPS_DNS_DOMAIN}" != *.k8s.local ]]; then |
| 24 | + >&2 echo "KOPS_DNS_DOMAIN must be (or end in) k8s.local for gossip; got ${KOPS_DNS_DOMAIN}" |
| 25 | + exit 1 |
| 26 | +fi |
| 27 | + |
| 28 | +source "${REPO_ROOT}"/tests/e2e/scenarios/lib/common.sh |
| 29 | +source "${REPO_ROOT}"/tests/e2e/scenarios/lib/upgrade.sh |
| 30 | + |
| 31 | +# Plain clusters only; the many-addons template is AWS-specific. |
| 32 | +unset KOPS_TEMPLATE |
| 33 | + |
| 34 | +# Gossip needs an NLB on AWS, any LB elsewhere. |
| 35 | +case "${CLOUD_PROVIDER}" in |
| 36 | + aws) |
| 37 | + cloud_args="--api-loadbalancer-type=public --api-loadbalancer-class=network" |
| 38 | + ;; |
| 39 | + gce) |
| 40 | + cloud_args="--api-loadbalancer-type=public --gce-service-account=default" |
| 41 | + ;; |
| 42 | + *) |
| 43 | + cloud_args="--api-loadbalancer-type=public" |
| 44 | + ;; |
| 45 | +esac |
| 46 | + |
| 47 | +# Drop dns-controller's priorityClassName so kops `validate cluster` ignores the pod. |
| 48 | +# The new image side-loads only on newly bootstrapped nodes, so until the rolling |
| 49 | +# update replaces the old ones the pod stays Pending, and would fail validation. |
| 50 | +override="--override=spec.externalDns.priorityClassName=" |
| 51 | + |
| 52 | +kops-upgrade "--networking cilium --dns=private ${cloud_args} ${override} ${KOPS_EXTRA_FLAGS:-}" |
0 commit comments