Skip to content

Commit a8cfb94

Browse files
MasonMJoibel
authored andcommitted
docs: autogenerate tested k8s versions and centralize config (#14176)
Signed-off-by: Mason Malone <[email protected]> (cherry picked from commit f5d59e9)
1 parent 68d8ace commit a8cfb94

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.27.3-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.27.3/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
@@ -242,15 +242,15 @@ jobs:
242242
profile: minimal
243243
use-api: true
244244
- test: test-executor
245-
install_k3s_version: v1.28.13+k3s1
245+
k8s_version: min
246246
profile: minimal
247247
use-api: false
248248
- test: test-corefunctional
249-
install_k3s_version: v1.28.13+k3s1
249+
k8s_version: min
250250
profile: minimal
251251
use-api: false
252252
- test: test-functional
253-
install_k3s_version: v1.28.13+k3s1
253+
k8s_version: min
254254
profile: minimal
255255
use-api: false
256256
steps:
@@ -283,12 +283,11 @@ jobs:
283283
python-version: '3.x'
284284
cache: pip
285285
- name: Install and start K3S
286+
env:
287+
K8S_VERSION: ${{ matrix.k8s_version || 'max' }}
286288
run: |
287-
if ! echo "${{ matrix.install_k3s_version }}" | egrep '^v[0-9]+\.[0-9]+\.[0-9]+\+k3s1$'; then
288-
export INSTALL_K3S_VERSION=v1.31.0+k3s1
289-
else
290-
export INSTALL_K3S_VERSION=${{ matrix.install_k3s_version }}
291-
fi
289+
. hack/k8s-versions.sh
290+
export INSTALL_K3S_VERSION="${K8S_VERSIONS[$K8S_VERSION]}+k3s1"
292291
293292
curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=stable \
294293
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
@@ -183,6 +183,7 @@ liveness
183183
localhost
184184
maxFailures
185185
maxSuccess
186+
md
186187
memoization
187188
memoized
188189
memoizing

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ endif
712712
.PHONY: docs-spellcheck
713713
docs-spellcheck: /usr/local/bin/mdspell
714714
# check docs for spelling mistakes
715-
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/*')
715+
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)
716716
# alphabetize spelling file -- ignore first line (comment), then sort the rest case-sensitive and remove duplicates
717717
$(shell cat .spelling | awk 'NR<2{ print $0; next } { print $0 | "LC_COLLATE=C sort" }' | uniq | tee .spelling > /dev/null)
718718

@@ -737,7 +737,7 @@ endif
737737
.PHONY: docs-lint
738738
docs-lint: /usr/local/bin/markdownlint
739739
# lint docs
740-
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
740+
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
741741

742742
/usr/local/bin/mkdocs:
743743
# update this in Nix when upgrading it here
@@ -756,6 +756,9 @@ docs: /usr/local/bin/mkdocs \
756756
# check environment-variables.md contains all variables mentioned in the code
757757
./hack/docs/check-env-doc.sh
758758
# build the docs
759+
ifeq ($(RELEASE_TAG),true)
760+
./hack/docs/tested-versions.sh > docs/tested-kubernetes-versions.md
761+
endif
759762
TZ=UTC mkdocs build --strict
760763
# tell the user the fastest way to edit docs
761764
@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.28 | 1.29 | 1.30 | 1.31 |
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.28](https://github.com/argoproj/argo-workflows/blob/main/.github/workflows/ci-build.yaml#L228) and [1.31](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
@@ -54,6 +54,7 @@ validation:
5454
exclude_docs: |
5555
/proposals/
5656
/requirements.txt
57+
/tested-kubernetes-versions.md
5758
5859
nav:
5960
- Home: README.md

0 commit comments

Comments
 (0)