Skip to content

feat(ci): add Kubernetes compatibility matrix - #2948

Open
slaskawi wants to merge 7 commits into
mainfrom
sebastianlaskawiec/core-675
Open

feat(ci): add Kubernetes compatibility matrix#2948
slaskawi wants to merge 7 commits into
mainfrom
sebastianlaskawiec/core-675

Conversation

@slaskawi

@slaskawi slaskawi commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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

  • New feature (non-breaking change which adds functionality)

Steps to Validate

  • yamllint .github/kubernetes-test-matrix.yaml .github/workflows/test-kubernetes-matrix.yaml .github/workflows/test.yaml tasks/setup.yaml tasks/test.yaml tasks/lint.yaml -c .yamllint --no-warnings
  • git diff --check
  • Verify the PR-triggered six-cell Kubernetes Compatibility matrix, followed by one-cell and selected-subset manual dispatches.

Checklist before merging

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>
@slaskawi
slaskawi marked this pull request as ready for review September 9, 2026 09:15
@slaskawi
slaskawi requested a review from a team as a code owner September 9, 2026 09:15
Copilot AI lite review requested due to automatic review settings September 9, 2026 09:15
@slaskawi

slaskawi commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@slaskawi

slaskawi commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T09:20:08.688839Z 65e9c61 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

The PR appears safe to merge after considering one non-blocking least-privilege hardening opportunity around reusable-workflow secrets.

Findings

  1. P2 Security Secrets are inherited broadly

Summary

  • Threads exact K3s versions through the reusable test workflow and UDS task hierarchy.
  • Validates requested versions, flavors, image architectures, and deployed server versions.
  • Keeps the documented compatibility table aligned with CI configuration.
  • Adds Renovate configuration for same-minor K3s matrix updates.
  • Introduces an avoidable broad secret boundary between the matrix and reusable test workflows.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Schedule, PR, or manual dispatch] --> B[Prepare matrix]
  B --> C[Validate K3s versions and flavors]
  C --> D[Verify amd64 and arm64 image manifests]
  D --> E{Version × flavor matrix}
  E --> F[Reusable test workflow]
  F --> G[Build UDS Core package]
  G --> H[Deploy requested uds-k3d image]
  H --> I[Verify K3s server version]
  I --> J[Run values-equivalency tests]
  J --> K[Aggregate matrix results]
  K -->|Scheduled failure| L[Slack notification]
Loading

Comment thread .github/workflows/test-kubernetes-matrix.yaml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread renovate.json

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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-matrix GitHub Actions workflow that runs a K3s version × flavor test matrix (nightly + PR triggers + manual subset inputs).
  • Plumbs an optional k3s_version input 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.

Comment thread tasks/lint.yaml Outdated
Comment thread renovate.json
"matchDepNames": [
"k3s-io/k3s"
],
"allowedVersions": "/^v{{major}}\\.{{minor}}\\.\\d+\\+k3s\\d+$/",
Comment thread docs/concepts/platform/supported-distributions.mdx
Comment thread .github/workflows/test-kubernetes-matrix.yaml Outdated
Comment thread .github/workflows/test-kubernetes-matrix.yaml
Comment thread .github/workflows/test.yaml Outdated
Comment thread tasks/setup.yaml
@slaskawi
slaskawi force-pushed the sebastianlaskawiec/core-675 branch from 2aef05e to ddbe7b7 Compare September 9, 2026 10:27
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Comment thread .github/workflows/pull-request-conditionals.yaml Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread .github/workflows/test-kubernetes-matrix.yaml
Comment thread tasks/lint.yaml
Comment thread tasks/test.yaml
default: ""
description: "Exact K3s version for the test cluster"
actions:
- description: "Exclude Portal from registry1 values tests"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved to tasks.yaml rather than here in the pipeline.

Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>

@joelmccoy joelmccoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple initial comments that might effect the shape of this pr

Comment on lines +10 to +11
"v1.34.4+k3s1",
"v1.35.8+k3s1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to bump this here: defenseunicorns/uds-k3d#382

Comment on lines +38 to +40
- ".github/workflows/test.yaml"
- "tasks/setup.yaml"
- "tasks/test.yaml"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +53 to +92
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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be reverted to the origin/main

type: string
description: "Exact K3s version for values tests"
required: false
default: ""

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants