Skip to content

Commit

Permalink
docs: autogenerate tested k8s versions and centralize config (#14176)
Browse files Browse the repository at this point in the history
Signed-off-by: Mason Malone <[email protected]>
  • Loading branch information
MasonM authored Feb 17, 2025
1 parent 02ddd7e commit f5d59e9
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 27 deletions.
9 changes: 5 additions & 4 deletions .devcontainer/pre-build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
set -eux

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

# install kubectl
curl -LO https://dl.k8s.io/release/v1.29.10/bin/linux/$(go env GOARCH)/kubectl
curl -LO "https://dl.k8s.io/release/${K8S_VERSIONS[min]}/bin/linux/$(go env GOARCH)/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl cluster-info
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ jobs:
profile: minimal
use-api: true
- test: test-executor
install_k3s_version: v1.29.13+k3s1
k8s_version: min
profile: minimal
use-api: false
- test: test-corefunctional
install_k3s_version: v1.29.13+k3s1
k8s_version: min
profile: minimal
use-api: false
- test: test-functional
install_k3s_version: v1.29.13+k3s1
k8s_version: min
profile: minimal
use-api: false
steps:
Expand Down Expand Up @@ -305,12 +305,11 @@ jobs:
# but it's noisy and makes the logs for "Start controller/API" hard to follow.
run: sudo apt-get -y install socat && make kit
- name: Install and start K3S
env:
K8S_VERSION: ${{ matrix.k8s_version || 'max' }}
run: |
if ! echo "${{ matrix.install_k3s_version }}" | egrep '^v[0-9]+\.[0-9]+\.[0-9]+\+k3s1$'; then
export INSTALL_K3S_VERSION=v1.32.1+k3s1
else
export INSTALL_K3S_VERSION=${{ matrix.install_k3s_version }}
fi
. hack/k8s-versions.sh
export INSTALL_K3S_VERSION="${K8S_VERSIONS[$K8S_VERSION]}+k3s1"
curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=stable \
INSTALL_K3S_EXEC="--docker --kubelet-arg=config=${GITHUB_WORKSPACE}/test/e2e/manifests/kubelet-configuration.yaml" \
Expand Down
1 change: 1 addition & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ liveness
localhost
maxFailures
maxSuccess
md
memoization
memoized
memoizing
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ endif
.PHONY: docs-spellcheck
docs-spellcheck: /usr/local/bin/mdspell docs/metrics.md
# check docs for spelling mistakes
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/*')
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)
# alphabetize spelling file -- ignore first line (comment), then sort the rest case-sensitive and remove duplicates
$(shell cat .spelling | awk 'NR<2{ print $0; next } { print $0 | "LC_COLLATE=C sort" }' | uniq | tee .spelling > /dev/null)

Expand All @@ -743,7 +743,7 @@ endif
.PHONY: docs-lint
docs-lint: /usr/local/bin/markdownlint docs/metrics.md
# lint docs
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
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

/usr/local/bin/mkdocs:
# update this in Nix when upgrading it here
Expand All @@ -762,6 +762,9 @@ docs: /usr/local/bin/mkdocs \
# check environment-variables.md contains all variables mentioned in the code
./hack/docs/check-env-doc.sh
# build the docs
ifeq ($(RELEASE_TAG),true)
./hack/docs/tested-versions.sh > docs/tested-kubernetes-versions.md
endif
TZ=UTC mkdocs build --strict
# tell the user the fastest way to edit docs
@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"
Expand Down
17 changes: 4 additions & 13 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,16 @@ Otherwise, we typically release every two weeks:
* Patch fixes for the current stable version.
* The next RC, if we are currently in a release cycle.

## Kubernetes Compatibility Matrix
## Tested Versions

| Argo Workflows \ Kubernetes | 1.29 | 1.30 | 1.31 | 1.32 |
|-----------------------------|------|------|------|------|
| **main** | `` | `` | `` | `` |
| **3.6** | `` | `` | `` | `?` |
| **3.5** | `` | `` | `?` | `?` |
| **3.4** | `?` | `?` | `?` | `?` |
--8<-- "docs/tested-kubernetes-versions.md"

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

### Notes on Compatibility

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

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.
The caveats with newer k8s versions are possible changes to experimental APIs and unused new features.
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.

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).
1 change: 1 addition & 0 deletions docs/tested-kubernetes-versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This section is only populated for released Argo Workflows versions.
4 changes: 4 additions & 0 deletions hack/docs/tested-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -eu
. hack/k8s-versions.sh
printf 'This version is tested under Kubernetes %s and %s.' "${K8S_VERSIONS[min]}" "${K8S_VERSIONS[max]}"
8 changes: 8 additions & 0 deletions hack/k8s-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Centralized config to define the minimum and maximum tested Kubernetes versions.
# This is used in the CI workflow for e2e tests, the devcontainer, and to generate docs.
declare -A K8S_VERSIONS=(
[min]=v1.29.13
[max]=v1.32.1
)
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ validation:
exclude_docs: |
/proposals/
/requirements.txt
/tested-kubernetes-versions.md
nav:
- Home: README.md
Expand Down

0 comments on commit f5d59e9

Please sign in to comment.