feat(ci): add Kubernetes compatibility matrix - #2948
Conversation
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
|
@codex review |
|
@greptileai review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The PR appears safe to merge after considering one non-blocking least-privilege hardening opportunity around reusable-workflow secrets. Findings
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65e9c61575
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🟡 Changes recommended
The current changes include a failing lint-script bug (flavor parsing whitespace) and an invalid Renovate allowedVersions pattern that will likely block updates.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a new CI workflow that exercises a K3s × flavor compatibility matrix, wiring a k3s_version input through the existing test workflow/task stack and updating lint/docs/renovate to keep versions aligned.
Changes:
- Introduces a new
test-kubernetes-matrixGitHub Actions workflow that runs a K3s version × flavor test matrix (nightly + PR triggers + manual subset inputs). - Plumbs an optional
k3s_versioninput through UDS tasks/workflows so values E2E tests can run against exact K3s releases. - Updates linting and documentation to reflect/validate the matrix and the documented supported distribution minors.
File summaries
| File | Description |
|---|---|
tasks/test.yaml |
Adds a k3s_version input to the values E2E task and forwards it into cluster setup. |
tasks/setup.yaml |
Adds optional K3s version selection for k3d cluster creation and validates the server version when requested. |
tasks/lint.yaml |
Extends the k8s version check to validate documented K3s minors against the new matrix workflow. |
renovate.json |
Adds Renovate rules intended to constrain/update K3s versions in the matrix workflow. |
docs/concepts/platform/supported-distributions.mdx |
Updates supported distributions page to reflect K3s minors and the new workflow coverage. |
.github/workflows/test.yaml |
Adds k3s_version input and passes it through to the values E2E task; updates log suffix. |
.github/workflows/test-kubernetes-matrix.yaml |
New workflow to run the K3s compatibility matrix and aggregate results. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "matchDepNames": [ | ||
| "k3s-io/k3s" | ||
| ], | ||
| "allowedVersions": "/^v{{major}}\\.{{minor}}\\.\\d+\\+k3s\\d+$/", |
2aef05e to
ddbe7b7
Compare
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
ddbe7b7 to
859b83e
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new matrix workflow’s input parsing can produce empty matrix entries and the updated lint task adds an unguarded jq dependency, both of which can cause avoidable CI/manual-run failures.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 2
- Review effort level: Lite
| default: "" | ||
| description: "Exact K3s version for the test cluster" | ||
| actions: | ||
| - description: "Exclude Portal from registry1 values tests" |
There was a problem hiding this comment.
This should be moved to tasks.yaml rather than here in the pipeline.
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
joelmccoy
left a comment
There was a problem hiding this comment.
A couple initial comments that might effect the shape of this pr
| "v1.34.4+k3s1", | ||
| "v1.35.8+k3s1" |
There was a problem hiding this comment.
we should be adding 1.35 and 1.37 to this instead... 1.37 is current. we should test normally on 1.36 (need to bump uds-k3d). This matrix should test n-2 and n
There was a problem hiding this comment.
going to bump this here: defenseunicorns/uds-k3d#382
| - ".github/workflows/test.yaml" | ||
| - "tasks/setup.yaml" | ||
| - "tasks/test.yaml" |
There was a problem hiding this comment.
I think it is overkill to include these. These will trigger on way more prs than we intend. And we are generally more conservative. I am ok trigger in the .github/workflows/test-kubernetes-matrix.yaml but i think everything else is not necessary.
| name: Prepare matrix | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| k3s_versions: ${{ steps.matrix.outputs.k3s_versions }} | ||
| flavors: ${{ steps.matrix.outputs.flavors }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
|
|
||
| - name: Convert matrix inputs | ||
| id: matrix | ||
| env: | ||
| K3S_MATRIX: ${{ env.K3S_MATRIX }} | ||
| K3S_VERSIONS_INPUT: ${{ inputs.k3s_versions }} | ||
| FLAVORS_INPUT: ${{ inputs.flavors }} | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| k3s_versions=$(printf '%s' "$K3S_MATRIX" | jq -c '.versions') | ||
| flavors=$(printf '%s' "$K3S_MATRIX" | jq -c '.flavors') | ||
|
|
||
| input_to_json() { | ||
| printf '%s' "$1" | jq -Rc 'split(",") | map(gsub("^\\s+|\\s+$"; "")) | map(select(length > 0))' | ||
| } | ||
|
|
||
| if [ -n "$K3S_VERSIONS_INPUT" ]; then | ||
| k3s_versions=$(input_to_json "$K3S_VERSIONS_INPUT") | ||
| fi | ||
| if [ -n "$FLAVORS_INPUT" ]; then | ||
| flavors=$(input_to_json "$FLAVORS_INPUT") | ||
| fi | ||
| { | ||
| echo "k3s_versions<<EOF" | ||
| echo "$k3s_versions" | ||
| echo "EOF" | ||
| echo "flavors<<EOF" | ||
| echo "$flavors" | ||
| echo "EOF" | ||
| } >> "$GITHUB_OUTPUT" | ||
|
|
There was a problem hiding this comment.
can't we get ride of this whole prepare step?? i feel like it is overkill if we can just use a native github matrix like so:
jobs:
test:
name: Kubernetes compatibility (${{ matrix.k3s_version }}, ${{ matrix.flavor }})
strategy:
fail-fast: false
matrix:
k3s_version:
- v1.34.4+k3s1
- v1.35.8+k3s1
flavor:
- upstream
- registry1
- unicorn
uses: ./.github/workflows/test.yaml| package: ${{ matrix.package }} | ||
| flavor: ${{ matrix.flavor }} | ||
| test_type: ${{ matrix.test_type }} | ||
| secrets: inherit # Inherits all secrets from the parent workflow. |
There was a problem hiding this comment.
This should be reverted to the origin/main
| type: string | ||
| description: "Exact K3s version for values tests" | ||
| required: false | ||
| default: "" |
There was a problem hiding this comment.
It's very hard to track what is the default Kubernetes version we're testing with. We need to use one default (for the non-matrix jobs) explicitly somewhere. It must be easy to spot.
Description
Adds the initial K3s compatibility matrix for exact K3s releases v1.34.4+k3s1 and v1.35.8+k3s1 across all supported flavors. The workflow runs nightly, on release-please and matrix changes, and supports manual version/flavor subsets.
Related Issue
Relates to #675
Type of change
Steps to Validate
Checklist before merging