Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade k0s version supported to 1.30 and update kindest node image in E2E tests to 1.32 #2496

Merged
merged 4 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ jobs:
- name: Set up kind k8s cluster
uses: engineerd/[email protected]
with:
version: "v0.20.0"
image: kindest/node:v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e
version: "v0.26.0"
image: kindest/node:v1.32.0@sha256:c48c62eac5da28cdadcf560d1d8616cfa6783b58f0d94cf63ad1bf49600cb027

- name: Testing kind cluster set-up
run: |
Expand Down Expand Up @@ -237,8 +237,8 @@ jobs:
- name: Set up kind k8s cluster
uses: engineerd/[email protected]
with:
version: "v0.20.0"
image: kindest/node:v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e
version: "v0.26.0"
image: kindest/node:v1.32.0@sha256:c48c62eac5da28cdadcf560d1d8616cfa6783b58f0d94cf63ad1bf49600cb027

- name: Testing kind cluster set-up
run: |
Expand Down Expand Up @@ -360,8 +360,8 @@ jobs:
- name: Set up kind k8s cluster
uses: engineerd/[email protected]
with:
version: "v0.20.0"
image: kindest/node:v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e
version: "v0.26.0"
image: kindest/node:v1.32.0@sha256:c48c62eac5da28cdadcf560d1d8616cfa6783b58f0d94cf63ad1bf49600cb027

- name: Testing kind cluster set-up
run: |
Expand Down
2 changes: 1 addition & 1 deletion config/default_extra_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var K3SVersionMap = map[string]string{

// K0SVersionMap holds the supported k0s versions
var K0SVersionMap = map[string]string{
"1.32": "k0sproject/k0s:v1.32.1-k0s.0",
"1.32": "k0sproject/k0s:v1.30.2-k0s.0",
"1.31": "k0sproject/k0s:v1.30.2-k0s.0",
"1.30": "k0sproject/k0s:v1.30.2-k0s.0",
"1.29": "k0sproject/k0s:v1.29.6-k0s.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/deploying-vclusters/compat-matrix.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Legend:

Compatibility matrix showing which host k8s version (left column) is supported by which vCluster k0s distro versions.

| | v1.32.1-k0s.0 | v1.30.2-k0s.0 | v1.30.2-k0s.0 | v1.29.6-k0s.0 | v1.28.11-k0s.0 | v1.27.16-k0s.0 |
| | v1.30.2-k0s.0 | v1.30.2-k0s.0 | v1.30.2-k0s.0 | v1.29.6-k0s.0 | v1.28.11-k0s.0 | v1.27.16-k0s.0 |
|------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
| 1.32 | :white_check_mark: | :ok: | :ok: | :ok: | :ok: | :ok: |
| 1.31 | :ok: | :white_check_mark: | :ok: | :ok: | :ok: | :ok: |
Expand Down
10 changes: 10 additions & 0 deletions pkg/controllers/resources/pods/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,16 @@ func (s *podSyncer) Sync(ctx *synccontext.SyncContext, event *synccontext.SyncEv
return ctrl.Result{}, err
}

// ignore the QOSClass field while updating pod status when there is a
// mismatch in this field value on vcluster and host. This field
// has become immutable from k8s 1.32 version and patch fails if
// syncer tries to update this field.
// This needs to be done before patch object is created when
// NewSyncerPatcher() is called so that there are no
// differences found in host QOSClass and virtual QOSClass and
// a patch event for this field is not created
event.Host.Status.QOSClass = event.VirtualOld.Status.QOSClass

// patch objects
patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.Pods.Patches, false))
if err != nil {
Expand Down
6 changes: 0 additions & 6 deletions pkg/controllers/resources/pods/translate/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ import (
)

func (t *translator) Diff(ctx *synccontext.SyncContext, event *synccontext.SyncEvent[*corev1.Pod]) error {
// ignore the QOSClass field while updating pod status when there is a
// mismatch in this field value on vcluster and host. This field
// has become immutable from k8s 1.32 version and patch fails if
// syncer tries to update this field.
event.Host.Status.QOSClass = event.VirtualOld.Status.QOSClass

// sync conditions
event.Virtual.Status.Conditions, event.Host.Status.Conditions = patcher.CopyBidirectional(
event.VirtualOld.Status.Conditions,
Expand Down
16 changes: 16 additions & 0 deletions test/e2e/syncer/pods/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ var _ = ginkgo.Describe("Pods are running in the host cluster", func() {

// ignore HostIP differences
resetHostIP(vpod, pod)

// Since k8s 1.32, status.QOSClass field has become immutable,
// hence we have stopeed syncing it. So ignore
// the differences in the status.QOSClass field
ignoreQOSClassDiff(vpod, pod)

framework.ExpectEqual(vpod.Status, pod.Status)

// check for ephemeralContainers subResource
Expand Down Expand Up @@ -144,6 +150,12 @@ var _ = ginkgo.Describe("Pods are running in the host cluster", func() {

// ignore HostIP differences
resetHostIP(vpod, pod)

// Since k8s 1.32, status.QOSClass field has become immutable,
// hence we have stopeed syncing it. So ignore
// the differences in the status.QOSClass field
ignoreQOSClassDiff(vpod, pod)

framework.ExpectEqual(vpod.Status, pod.Status)

// check for conditions
Expand Down Expand Up @@ -694,3 +706,7 @@ func resetHostIP(vpod, pod *corev1.Pod) {
vpod.Status.HostIP, pod.Status.HostIP = "", ""
vpod.Status.HostIPs, pod.Status.HostIPs = nil, nil
}

func ignoreQOSClassDiff(vpod, pod *corev1.Pod) {
pod.Status.QOSClass = vpod.Status.QOSClass
}
Loading