Skip to content

Commit f5d59e9

Browse files
authored
docs: autogenerate tested k8s versions and centralize config (#14176)
Signed-off-by: Mason Malone <[email protected]>
1 parent 02ddd7e commit f5d59e9

File tree

9 files changed

+36
-27
lines changed

9 files changed

+36
-27
lines changed

.devcontainer/pre-build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
#!/usr/bin/env sh
1+
#!/usr/bin/env bash
22
set -eux
33

4-
# install kubernetes
4+
# install kubernetes using the minimum tested version
5+
. hack/k8s-versions.sh
56
wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
6-
k3d cluster get k3s-default || k3d cluster create --image rancher/k3s:v1.29.10-k3s1 --wait
7+
k3d cluster get k3s-default || k3d cluster create --image "rancher/k3s:${K8S_VERSIONS[min]}-k3s1" --wait
78
k3d kubeconfig merge --kubeconfig-merge-default
89

910
# install kubectl
10-
curl -LO https://dl.k8s.io/release/v1.29.10/bin/linux/$(go env GOARCH)/kubectl
11+
curl -LO "https://dl.k8s.io/release/${K8S_VERSIONS[min]}/bin/linux/$(go env GOARCH)/kubectl"
1112
chmod +x ./kubectl
1213
sudo mv ./kubectl /usr/local/bin/kubectl
1314
kubectl cluster-info

.github/workflows/ci-build.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,15 +260,15 @@ jobs:
260260
profile: minimal
261261
use-api: true
262262
- test: test-executor
263-
install_k3s_version: v1.29.13+k3s1
263+
k8s_version: min
264264
profile: minimal
265265
use-api: false
266266
- test: test-corefunctional
267-
install_k3s_version: v1.29.13+k3s1
267+
k8s_version: min
268268
profile: minimal
269269
use-api: false
270270
- test: test-functional
271-
install_k3s_version: v1.29.13+k3s1
271+
k8s_version: min
272272
profile: minimal
273273
use-api: false
274274
steps:
@@ -305,12 +305,11 @@ jobs:
305305
# but it's noisy and makes the logs for "Start controller/API" hard to follow.
306306
run: sudo apt-get -y install socat && make kit
307307
- name: Install and start K3S
308+
env:
309+
K8S_VERSION: ${{ matrix.k8s_version || 'max' }}
308310
run: |
309-
if ! echo "${{ matrix.install_k3s_version }}" | egrep '^v[0-9]+\.[0-9]+\.[0-9]+\+k3s1$'; then
310-
export INSTALL_K3S_VERSION=v1.32.1+k3s1
311-
else
312-
export INSTALL_K3S_VERSION=${{ matrix.install_k3s_version }}
313-
fi
311+
. hack/k8s-versions.sh
312+
export INSTALL_K3S_VERSION="${K8S_VERSIONS[$K8S_VERSION]}+k3s1"
314313
315314
curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=stable \
316315
INSTALL_K3S_EXEC="--docker --kubelet-arg=config=${GITHUB_WORKSPACE}/test/e2e/manifests/kubelet-configuration.yaml" \

.spelling

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ liveness
189189
localhost
190190
maxFailures
191191
maxSuccess
192+
md
192193
memoization
193194
memoized
194195
memoizing

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ endif
718718
.PHONY: docs-spellcheck
719719
docs-spellcheck: /usr/local/bin/mdspell docs/metrics.md
720720
# check docs for spelling mistakes
721-
mdspell --ignore-numbers --ignore-acronyms --en-us --no-suggestions --report $(shell find docs -name '*.md' -not -name upgrading.md -not -name README.md -not -name fields.md -not -name upgrading.md -not -name executor_swagger.md -not -path '*/cli/*')
721+
mdspell --ignore-numbers --ignore-acronyms --en-us --no-suggestions --report $(shell find docs -name '*.md' -not -name upgrading.md -not -name README.md -not -name fields.md -not -name upgrading.md -not -name executor_swagger.md -not -path '*/cli/*' -not -name tested-kubernetes-versions.md)
722722
# alphabetize spelling file -- ignore first line (comment), then sort the rest case-sensitive and remove duplicates
723723
$(shell cat .spelling | awk 'NR<2{ print $0; next } { print $0 | "LC_COLLATE=C sort" }' | uniq | tee .spelling > /dev/null)
724724

@@ -743,7 +743,7 @@ endif
743743
.PHONY: docs-lint
744744
docs-lint: /usr/local/bin/markdownlint docs/metrics.md
745745
# lint docs
746-
markdownlint docs --fix --ignore docs/fields.md --ignore docs/executor_swagger.md --ignore docs/cli --ignore docs/walk-through/the-structure-of-workflow-specs.md
746+
markdownlint docs --fix --ignore docs/fields.md --ignore docs/executor_swagger.md --ignore docs/cli --ignore docs/walk-through/the-structure-of-workflow-specs.md --ignore docs/tested-kubernetes-versions.md
747747

748748
/usr/local/bin/mkdocs:
749749
# update this in Nix when upgrading it here
@@ -762,6 +762,9 @@ docs: /usr/local/bin/mkdocs \
762762
# check environment-variables.md contains all variables mentioned in the code
763763
./hack/docs/check-env-doc.sh
764764
# build the docs
765+
ifeq ($(RELEASE_TAG),true)
766+
./hack/docs/tested-versions.sh > docs/tested-kubernetes-versions.md
767+
endif
765768
TZ=UTC mkdocs build --strict
766769
# tell the user the fastest way to edit docs
767770
@echo "ℹ️ If you want to preview your docs, open site/index.html. If you want to edit them with hot-reload, run 'make docs-serve' to start mkdocs on port 8000"

docs/releases.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,16 @@ Otherwise, we typically release every two weeks:
3838
* Patch fixes for the current stable version.
3939
* The next RC, if we are currently in a release cycle.
4040

41-
## Kubernetes Compatibility Matrix
41+
## Tested Versions
4242

43-
| Argo Workflows \ Kubernetes | 1.29 | 1.30 | 1.31 | 1.32 |
44-
|-----------------------------|------|------|------|------|
45-
| **main** | `` | `` | `` | `` |
46-
| **3.6** | `` | `` | `` | `?` |
47-
| **3.5** | `` | `` | `?` | `?` |
48-
| **3.4** | `?` | `?` | `?` | `?` |
43+
--8<-- "docs/tested-kubernetes-versions.md"
4944

50-
* `` Fully supported versions.
51-
* `?` Due to breaking changes might not work. Also, we haven't thoroughly tested against this version.
52-
* `` Unsupported versions.
45+
Use the version selector to view the tested Kubernetes versions for a specific Argo Workflows version.
5346

5447
### Notes on Compatibility
5548

56-
Argo versions may be compatible with newer and older Kubernetes versions (indicated by `?`), but only three minor versions are tested unless otherwise noted.
49+
Argo versions may be compatible with newer and older Kubernetes versions, but only two minor versions are tested.
5750

5851
Note that Kubernetes [is backward compatible with clients](https://github.com/kubernetes/client-go/tree/aa7909e7d7c0661792ba21b9e882f3cd6ad0ce53?tab=readme-ov-file#compatibility-client-go---kubernetes-clusters), so newer k8s versions are generally supported.
5952
The caveats with newer k8s versions are possible changes to experimental APIs and unused new features.
6053
Argo uses stable Kubernetes APIs such as Pods and ConfigMaps; see the Controller and Server RBAC of your [installation](installation.md) for a full list.
61-
62-
The `main` branch is currently [tested on Kubernetes 1.29](https://github.com/argoproj/argo-workflows/blob/main/.github/workflows/ci-build.yaml#L228) and [1.32](https://github.com/argoproj/argo-workflows/blob/main/.github/workflows/ci-build.yaml#L263).

docs/tested-kubernetes-versions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This section is only populated for released Argo Workflows versions.

hack/docs/tested-versions.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
. hack/k8s-versions.sh
4+
printf 'This version is tested under Kubernetes %s and %s.' "${K8S_VERSIONS[min]}" "${K8S_VERSIONS[max]}"

hack/k8s-versions.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# Centralized config to define the minimum and maximum tested Kubernetes versions.
4+
# This is used in the CI workflow for e2e tests, the devcontainer, and to generate docs.
5+
declare -A K8S_VERSIONS=(
6+
[min]=v1.29.13
7+
[max]=v1.32.1
8+
)

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ validation:
5555
exclude_docs: |
5656
/proposals/
5757
/requirements.txt
58+
/tested-kubernetes-versions.md
5859
5960
nav:
6061
- Home: README.md

0 commit comments

Comments
 (0)