Skip to content

feat(cluster): step a server down and back up under memory pressure without losing its etcd vote #31

feat(cluster): step a server down and back up under memory pressure without losing its etcd vote

feat(cluster): step a server down and back up under memory pressure without losing its etcd vote #31

Workflow file for this run

name: Helm apply
# Runs the ARC role's Helm version read and scale-set helm task in a kind cluster with Helm 4 and Helm 3 (tests/helm_apply/run.sh): a release whose maxRunners kubectl has patched, as the autoscaler does, is upgraded to a different value, a release first installed client-side moves to server-side apply, and Helm 3 is passed neither server-side option.
#
# GitHub-hosted ubuntu-latest has Docker, kind and kubectl already. Both Helm releases are downloaded and checked against SHA-256 digests pinned here, taken from Helm's GitHub release notes and matching get.helm.sh's .sha256sum files, so the test depends neither on the image's own Helm nor on the download host vouching for its own archive. Each phase also runs with the oldest kubernetes.core galaxy.yml accepts, as well as the newest.
on:
pull_request:
paths:
- roles/github_runner_arc/tasks/main.yml
- roles/github_runner_arc/tasks/install_controller.yml
- roles/github_runner_arc/tasks/install_scale_set_profile.yml
- plugins/filter/arc.py
- tests/helm_apply/**
- .github/workflows/helm-apply.yml
- galaxy.yml
workflow_dispatch:
concurrency:
group: helm-apply-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
helm-apply:
name: Helm apply in kind
runs-on: ubuntu-latest
timeout-minutes: 30
env:
HELM3_VERSION: v3.18.6
HELM3_SHA256: 3f43c0aa57243852dd542493a0f54f1396c0bc8ec7296bbb2c01e802010819ce
HELM4_VERSION: v4.3.0
HELM4_SHA256: 86584a54def73570558f66f5111cc53dfed56689637ae32c1201205d494f54fb
steps:
- uses: actions/checkout@v7
- name: Install Ansible and the Kubernetes collection
run: |
set -euo pipefail
if ! python3 -m venv "${RUNNER_TEMP}/venv" 2>/dev/null; then
sudo apt-get update -qq
sudo apt-get install -y -qq python3-venv
python3 -m venv "${RUNNER_TEMP}/venv"
fi
"${RUNNER_TEMP}/venv/bin/pip" install --quiet --prefer-binary ansible-core kubernetes pyyaml
echo "${RUNNER_TEMP}/venv/bin" >> "$GITHUB_PATH"
# The newest kubernetes.core in the default path, and exactly the lowest one galaxy.yml accepts in a path of its own.
floor="$(PYTHON="${RUNNER_TEMP}/venv/bin/python" tests/helm_apply/kubernetes-core-floor.sh)"
"${RUNNER_TEMP}/venv/bin/ansible-galaxy" collection install "kubernetes.core>=${floor}"
# --force: otherwise ansible-galaxy counts the newest already in the default path as satisfying ==floor when the two are the same version, and installs nothing into the floor path.
"${RUNNER_TEMP}/venv/bin/ansible-galaxy" collection install --force "kubernetes.core==${floor}" -p "${RUNNER_TEMP}/kubernetes-core-floor"
- name: Download Helm 3 and Helm 4
run: |
set -euo pipefail
for pair in "${HELM3_VERSION}:${HELM3_SHA256}" "${HELM4_VERSION}:${HELM4_SHA256}"; do
version="${pair%%:*}"
archive="helm-${version}-linux-amd64.tar.gz"
curl -fsSLo "${RUNNER_TEMP}/${archive}" "https://get.helm.sh/${archive}"
# sha256sum -c exits non-zero on a mismatch, which fails the step under set -e.
echo "${pair#*:} ${RUNNER_TEMP}/${archive}" | sha256sum -c -
mkdir -p "${RUNNER_TEMP}/${version}"
tar -xzf "${RUNNER_TEMP}/${archive}" -C "${RUNNER_TEMP}/${version}"
done
- name: Run the Helm apply test
run: |
HELM3="${RUNNER_TEMP}/${HELM3_VERSION}/linux-amd64/helm" \
HELM4="${RUNNER_TEMP}/${HELM4_VERSION}/linux-amd64/helm" \
KUBERNETES_CORE_FLOOR="${RUNNER_TEMP}/kubernetes-core-floor" \
tests/helm_apply/run.sh