From b8da5ef485a58c89be6aaa27b0e8ba2802721557 Mon Sep 17 00:00:00 2001 From: Ivo Petrov Date: Fri, 1 Nov 2024 17:32:59 +0200 Subject: [PATCH 1/6] K3s naming standartization --- .../k3s-upgrade/plan-bundle.yaml | 12 ++++++------ .../k3s-upgrade/plan-agent.yaml | 8 ++++---- .../k3s-upgrade/plan-control-plane.yaml | 3 ++- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/bundles/day2/system-upgrade-controller-plans/k3s-upgrade/plan-bundle.yaml b/bundles/day2/system-upgrade-controller-plans/k3s-upgrade/plan-bundle.yaml index 3ed3980..131c682 100644 --- a/bundles/day2/system-upgrade-controller-plans/k3s-upgrade/plan-bundle.yaml +++ b/bundles/day2/system-upgrade-controller-plans/k3s-upgrade/plan-bundle.yaml @@ -6,11 +6,11 @@ metadata: spec: resources: - content: | - # control-plane upgrade plan + # SUC Plan related to upgrading the K3s version of control-plane nodes apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: - name: k3s-plan-control-plane + name: k3s-upgrade-control-plane namespace: cattle-system labels: k3s-upgrade: control-plane @@ -37,14 +37,14 @@ spec: image: rancher/k3s-upgrade version: v1.30.3+k3s1 --- - # worker upgrade plan + # SUC Plan related to upgrading the K3s version of worker nodes apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: - name: k3s-plan-agent + name: k3s-upgrade-worker namespace: cattle-system labels: - k3s-upgrade: agent + k3s-upgrade: worker spec: concurrency: 2 nodeSelector: @@ -56,7 +56,7 @@ spec: image: rancher/k3s-upgrade args: - prepare - - k3s-plan-control-plane + - k3s-upgrade-control-plane cordon: true upgrade: image: rancher/k3s-upgrade diff --git a/fleets/day2/system-upgrade-controller-plans/k3s-upgrade/plan-agent.yaml b/fleets/day2/system-upgrade-controller-plans/k3s-upgrade/plan-agent.yaml index 2cde034..3b688ed 100644 --- a/fleets/day2/system-upgrade-controller-plans/k3s-upgrade/plan-agent.yaml +++ b/fleets/day2/system-upgrade-controller-plans/k3s-upgrade/plan-agent.yaml @@ -1,10 +1,10 @@ -# worker upgrade plan +# SUC Plan related to upgrading the K3s version of worker nodes apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: - name: k3s-plan-agent + name: k3s-upgrade-worker labels: - k3s-upgrade: agent + k3s-upgrade: worker spec: concurrency: 2 nodeSelector: @@ -16,7 +16,7 @@ spec: image: rancher/k3s-upgrade args: - prepare - - k3s-plan-control-plane + - k3s-upgrade-control-plane cordon: true upgrade: image: rancher/k3s-upgrade diff --git a/fleets/day2/system-upgrade-controller-plans/k3s-upgrade/plan-control-plane.yaml b/fleets/day2/system-upgrade-controller-plans/k3s-upgrade/plan-control-plane.yaml index 43ddff8..e6487f3 100644 --- a/fleets/day2/system-upgrade-controller-plans/k3s-upgrade/plan-control-plane.yaml +++ b/fleets/day2/system-upgrade-controller-plans/k3s-upgrade/plan-control-plane.yaml @@ -1,7 +1,8 @@ +# SUC Plan related to upgrading the K3s version of control-plane nodes apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: - name: k3s-plan-control-plane + name: k3s-upgrade-control-plane labels: k3s-upgrade: control-plane spec: From bc1dd4016aa63d8b8fd9670243a005c866902c43 Mon Sep 17 00:00:00 2001 From: Ivo Petrov Date: Fri, 1 Nov 2024 17:33:46 +0200 Subject: [PATCH 2/6] RKE2 naming standartization --- .../rke2-upgrade/plan-bundle.yaml | 12 ++++++------ .../rke2-upgrade/plan-agent.yaml | 7 ++++--- .../rke2-upgrade/plan-control-plane.yaml | 3 ++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/bundles/day2/system-upgrade-controller-plans/rke2-upgrade/plan-bundle.yaml b/bundles/day2/system-upgrade-controller-plans/rke2-upgrade/plan-bundle.yaml index c6c5a77..edbe99f 100644 --- a/bundles/day2/system-upgrade-controller-plans/rke2-upgrade/plan-bundle.yaml +++ b/bundles/day2/system-upgrade-controller-plans/rke2-upgrade/plan-bundle.yaml @@ -6,11 +6,11 @@ metadata: spec: resources: - content: | - # control-plane upgrade plan + # SUC Plan related to upgrading the RKE2 version of control-plane nodes apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: - name: rke2-plan-control-plane + name: rke2-upgrade-control-plane namespace: cattle-system labels: rke2-upgrade: control-plane @@ -37,14 +37,14 @@ spec: image: rancher/rke2-upgrade version: v1.30.3+rke2r1 --- - # worker upgrade plan + # SUC Plan related to upgrading the RKE2 version of worker nodes apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: - name: rke2-plan-agent + name: rke2-upgrade-worker namespace: cattle-system labels: - rke2-upgrade: agent + rke2-upgrade: worker spec: concurrency: 2 nodeSelector: @@ -54,7 +54,7 @@ spec: prepare: args: - prepare - - rke2-plan-control-plane + - rke2-upgrade-control-plane image: rancher/rke2-upgrade serviceAccountName: system-upgrade-controller cordon: true diff --git a/fleets/day2/system-upgrade-controller-plans/rke2-upgrade/plan-agent.yaml b/fleets/day2/system-upgrade-controller-plans/rke2-upgrade/plan-agent.yaml index 1811be5..e61494e 100644 --- a/fleets/day2/system-upgrade-controller-plans/rke2-upgrade/plan-agent.yaml +++ b/fleets/day2/system-upgrade-controller-plans/rke2-upgrade/plan-agent.yaml @@ -1,9 +1,10 @@ +# SUC Plan related to upgrading the RKE2 version of worker nodes apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: - name: rke2-plan-agent + name: rke2-upgrade-worker labels: - rke2-upgrade: agent + rke2-upgrade: worker spec: concurrency: 2 nodeSelector: @@ -13,7 +14,7 @@ spec: prepare: args: - prepare - - rke2-plan-control-plane + - rke2-upgrade-control-plane image: rancher/rke2-upgrade serviceAccountName: system-upgrade-controller cordon: true diff --git a/fleets/day2/system-upgrade-controller-plans/rke2-upgrade/plan-control-plane.yaml b/fleets/day2/system-upgrade-controller-plans/rke2-upgrade/plan-control-plane.yaml index b5b57a5..78b0ef3 100644 --- a/fleets/day2/system-upgrade-controller-plans/rke2-upgrade/plan-control-plane.yaml +++ b/fleets/day2/system-upgrade-controller-plans/rke2-upgrade/plan-control-plane.yaml @@ -1,7 +1,8 @@ +# SUC Plan related to upgrading the RKE2 version of control-plane nodes apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: - name: rke2-plan-control-plane + name: rke2-upgrade-control-plane labels: rke2-upgrade: control-plane spec: From 07d47bbe20cc8b9e6c2df41fd2d02e3a129e8125 Mon Sep 17 00:00:00 2001 From: Ivo Petrov Date: Fri, 1 Nov 2024 17:35:35 +0200 Subject: [PATCH 3/6] OS naming standartization --- .../os-upgrade/os-upgrade-bundle.yaml | 35 +++++++++++-------- .../os-upgrade/config-map.yaml | 3 +- .../os-upgrade/plan-agent.yaml | 17 ++++----- .../os-upgrade/plan-control-plane.yaml | 11 +++--- .../os-upgrade/secret.yaml | 4 ++- 5 files changed, 40 insertions(+), 30 deletions(-) diff --git a/bundles/day2/system-upgrade-controller-plans/os-upgrade/os-upgrade-bundle.yaml b/bundles/day2/system-upgrade-controller-plans/os-upgrade/os-upgrade-bundle.yaml index 3f9d2c0..8e0b621 100644 --- a/bundles/day2/system-upgrade-controller-plans/os-upgrade/os-upgrade-bundle.yaml +++ b/bundles/day2/system-upgrade-controller-plans/os-upgrade/os-upgrade-bundle.yaml @@ -6,15 +6,16 @@ metadata: spec: resources: - content: | + # SUC Plan related to upgrading/migrating the operating system of worker nodes apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: - name: agent-os-upgrade-edge-310 + name: os-upgrade-worker namespace: cattle-system spec: concurrency: 1 # Override default SUC set value of 900 with something that will - # give the enough time to the agent plan to finish + # give the enough time to the worker plan to finish jobActiveDeadlineSecs: 43200 nodeSelector: matchExpressions: @@ -22,8 +23,8 @@ spec: - {key: node-role.kubernetes.io/control-plane, operator: NotIn, values: ["true"]} serviceAccountName: system-upgrade-controller secrets: - - name: os-upgrade-edge-310 - path: /host/run/system-upgrade/secrets/os-upgrade-edge-310 + - name: os-upgrade-script + path: /host/run/system-upgrade/secrets/os-upgrade-script cordon: true version: "3.1.0" prepare: @@ -41,7 +42,7 @@ spec: if [ -n "$PLAN_APPLYING_CHECK" ]; then echo "SUC has not yet cleared ${MASTER_PLAN} plan 'status.applying' list. Checking again in ${CHECK_INTERVAL} seconds..." else - echo "${MASTER_PLAN} control-plane upgrade has finished. Proceeding to agent node upgrade.." + echo "${MASTER_PLAN} control-plane upgrade has finished. Proceeding to worker node upgrade.." break fi fi @@ -49,7 +50,7 @@ spec: done envs: - name: MASTER_PLAN - value: "cp-os-upgrade-edge-310" + value: "os-upgrade-control-plane" - name: NAMESPACE valueFrom: fieldRef: @@ -57,15 +58,16 @@ spec: upgrade: image: registry.suse.com/bci/bci-base:15.6 command: ["chroot", "/host"] - args: ["sh", "/run/system-upgrade/secrets/os-upgrade-edge-310/upgrade.sh"] + args: ["sh", "/run/system-upgrade/secrets/os-upgrade-script/upgrade.sh"] envFrom: - configMapRef: - name: os-upgrade-edge-310 + name: os-upgrade-config --- + # SUC Plan related to upgrading/migrating the operating system of control-plane nodes apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: - name: cp-os-upgrade-edge-310 + name: os-upgrade-control-plane namespace: cattle-system spec: concurrency: 1 @@ -89,22 +91,24 @@ spec: effect: "NoExecute" serviceAccountName: system-upgrade-controller secrets: - - name: os-upgrade-edge-310 - path: /host/run/system-upgrade/secrets/os-upgrade-edge-310 + - name: os-upgrade-script + path: /host/run/system-upgrade/secrets/os-upgrade-script cordon: true version: "3.1.0" upgrade: image: registry.suse.com/bci/bci-base:15.6 command: ["chroot", "/host"] - args: ["sh", "/run/system-upgrade/secrets/os-upgrade-edge-310/upgrade.sh"] + args: ["sh", "/run/system-upgrade/secrets/os-upgrade-script/upgrade.sh"] envFrom: - configMapRef: - name: os-upgrade-edge-310 + name: os-upgrade-config --- + # Secret containing the script that is used by the + # SUC Plans for operating system migration/upgrade apiVersion: v1 kind: Secret metadata: - name: os-upgrade-edge-310 + name: os-upgrade-script namespace: cattle-system type: Opaque stringData: @@ -199,10 +203,11 @@ spec: executeUpgrade --- + # Configurations for the operating system migration/upgrade workflow apiVersion: v1 kind: ConfigMap metadata: - name: os-upgrade-edge-310 + name: os-upgrade-config namespace: cattle-system data: EDGE_RELEASE_CPE: "cpe:/o:suse:sl-micro:6.0" diff --git a/fleets/day2/system-upgrade-controller-plans/os-upgrade/config-map.yaml b/fleets/day2/system-upgrade-controller-plans/os-upgrade/config-map.yaml index 69341bb..6728d03 100644 --- a/fleets/day2/system-upgrade-controller-plans/os-upgrade/config-map.yaml +++ b/fleets/day2/system-upgrade-controller-plans/os-upgrade/config-map.yaml @@ -1,7 +1,8 @@ +# Configurations for the operating system migration/upgrade workflow apiVersion: v1 kind: ConfigMap metadata: - name: os-upgrade-edge-310 + name: os-upgrade-config data: EDGE_RELEASE_CPE: "cpe:/o:suse:sl-micro:6.0" SL_MICRO_ZYPPER_ID: "SL-Micro" diff --git a/fleets/day2/system-upgrade-controller-plans/os-upgrade/plan-agent.yaml b/fleets/day2/system-upgrade-controller-plans/os-upgrade/plan-agent.yaml index 034511e..2583a2e 100644 --- a/fleets/day2/system-upgrade-controller-plans/os-upgrade/plan-agent.yaml +++ b/fleets/day2/system-upgrade-controller-plans/os-upgrade/plan-agent.yaml @@ -1,11 +1,12 @@ +# SUC Plan related to upgrading/migrating the operating system of worker nodes apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: - name: agent-os-upgrade-edge-310 + name: os-upgrade-worker spec: concurrency: 1 # Override default SUC set value of 900 with something that will - # give the enough time to the agent plan to finish + # give the enough time to the worker plan to finish jobActiveDeadlineSecs: 43200 nodeSelector: matchExpressions: @@ -13,8 +14,8 @@ spec: - {key: node-role.kubernetes.io/control-plane, operator: NotIn, values: ["true"]} serviceAccountName: system-upgrade-controller secrets: - - name: os-upgrade-edge-310 - path: /host/run/system-upgrade/secrets/os-upgrade-edge-310 + - name: os-upgrade-script + path: /host/run/system-upgrade/secrets/os-upgrade-script cordon: true version: "3.1.0" prepare: @@ -32,7 +33,7 @@ spec: if [ -n "$PLAN_APPLYING_CHECK" ]; then echo "SUC has not yet cleared ${MASTER_PLAN} plan 'status.applying' list. Checking again in ${CHECK_INTERVAL} seconds..." else - echo "${MASTER_PLAN} control-plane upgrade has finished. Proceeding to agent node upgrade.." + echo "${MASTER_PLAN} control-plane upgrade has finished. Proceeding to worker node upgrade.." break fi fi @@ -40,7 +41,7 @@ spec: done envs: - name: MASTER_PLAN - value: "cp-os-upgrade-edge-310" + value: "os-upgrade-control-plane" - name: NAMESPACE valueFrom: fieldRef: @@ -48,7 +49,7 @@ spec: upgrade: image: registry.suse.com/bci/bci-base:15.6 command: ["chroot", "/host"] - args: ["sh", "/run/system-upgrade/secrets/os-upgrade-edge-310/upgrade.sh"] + args: ["sh", "/run/system-upgrade/secrets/os-upgrade-script/upgrade.sh"] envFrom: - configMapRef: - name: os-upgrade-edge-310 + name: os-upgrade-config diff --git a/fleets/day2/system-upgrade-controller-plans/os-upgrade/plan-control-plane.yaml b/fleets/day2/system-upgrade-controller-plans/os-upgrade/plan-control-plane.yaml index 217ee9e..a6dee3a 100644 --- a/fleets/day2/system-upgrade-controller-plans/os-upgrade/plan-control-plane.yaml +++ b/fleets/day2/system-upgrade-controller-plans/os-upgrade/plan-control-plane.yaml @@ -1,7 +1,8 @@ +# SUC Plan related to upgrading/migrating the operating system of control-plane nodes apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: - name: cp-os-upgrade-edge-310 + name: os-upgrade-control-plane spec: concurrency: 1 # Override the default SUC set value of 900 with something that will @@ -24,14 +25,14 @@ spec: effect: "NoExecute" serviceAccountName: system-upgrade-controller secrets: - - name: os-upgrade-edge-310 - path: /host/run/system-upgrade/secrets/os-upgrade-edge-310 + - name: os-upgrade-script + path: /host/run/system-upgrade/secrets/os-upgrade-script cordon: true version: "3.1.0" upgrade: image: registry.suse.com/bci/bci-base:15.6 command: ["chroot", "/host"] - args: ["sh", "/run/system-upgrade/secrets/os-upgrade-edge-310/upgrade.sh"] + args: ["sh", "/run/system-upgrade/secrets/os-upgrade-script/upgrade.sh"] envFrom: - configMapRef: - name: os-upgrade-edge-310 + name: os-upgrade-config diff --git a/fleets/day2/system-upgrade-controller-plans/os-upgrade/secret.yaml b/fleets/day2/system-upgrade-controller-plans/os-upgrade/secret.yaml index 7d5dfea..6152e45 100644 --- a/fleets/day2/system-upgrade-controller-plans/os-upgrade/secret.yaml +++ b/fleets/day2/system-upgrade-controller-plans/os-upgrade/secret.yaml @@ -1,7 +1,9 @@ +# Secret containing the script that is used by the +# SUC Plans for operating system migration/upgrade apiVersion: v1 kind: Secret metadata: - name: os-upgrade-edge-310 + name: os-upgrade-script type: Opaque stringData: upgrade.sh: | From f556f1891c9775997221f313a19285453677a692 Mon Sep 17 00:00:00 2001 From: Ivo Petrov Date: Fri, 1 Nov 2024 17:36:22 +0200 Subject: [PATCH 4/6] Rename agent plans to worker --- .../k3s-upgrade/{plan-agent.yaml => plan-worker.yaml} | 0 .../os-upgrade/{plan-agent.yaml => plan-worker.yaml} | 0 .../rke2-upgrade/{plan-agent.yaml => plan-worker.yaml} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename fleets/day2/system-upgrade-controller-plans/k3s-upgrade/{plan-agent.yaml => plan-worker.yaml} (100%) rename fleets/day2/system-upgrade-controller-plans/os-upgrade/{plan-agent.yaml => plan-worker.yaml} (100%) rename fleets/day2/system-upgrade-controller-plans/rke2-upgrade/{plan-agent.yaml => plan-worker.yaml} (100%) diff --git a/fleets/day2/system-upgrade-controller-plans/k3s-upgrade/plan-agent.yaml b/fleets/day2/system-upgrade-controller-plans/k3s-upgrade/plan-worker.yaml similarity index 100% rename from fleets/day2/system-upgrade-controller-plans/k3s-upgrade/plan-agent.yaml rename to fleets/day2/system-upgrade-controller-plans/k3s-upgrade/plan-worker.yaml diff --git a/fleets/day2/system-upgrade-controller-plans/os-upgrade/plan-agent.yaml b/fleets/day2/system-upgrade-controller-plans/os-upgrade/plan-worker.yaml similarity index 100% rename from fleets/day2/system-upgrade-controller-plans/os-upgrade/plan-agent.yaml rename to fleets/day2/system-upgrade-controller-plans/os-upgrade/plan-worker.yaml diff --git a/fleets/day2/system-upgrade-controller-plans/rke2-upgrade/plan-agent.yaml b/fleets/day2/system-upgrade-controller-plans/rke2-upgrade/plan-worker.yaml similarity index 100% rename from fleets/day2/system-upgrade-controller-plans/rke2-upgrade/plan-agent.yaml rename to fleets/day2/system-upgrade-controller-plans/rke2-upgrade/plan-worker.yaml From d01da90fd5550e53a28419b73141d3217cd0151d Mon Sep 17 00:00:00 2001 From: Ivo Petrov Date: Fri, 1 Nov 2024 17:39:23 +0200 Subject: [PATCH 5/6] Rename os gitrepo to reflect correct procedure --- gitrepos/day2/{os-update-gitrepo.yaml => os-upgrade-gitrepo.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gitrepos/day2/{os-update-gitrepo.yaml => os-upgrade-gitrepo.yaml} (100%) diff --git a/gitrepos/day2/os-update-gitrepo.yaml b/gitrepos/day2/os-upgrade-gitrepo.yaml similarity index 100% rename from gitrepos/day2/os-update-gitrepo.yaml rename to gitrepos/day2/os-upgrade-gitrepo.yaml From 5b4f535576284ee239dabb4cca55bd0b2ac60c7e Mon Sep 17 00:00:00 2001 From: Ivo Petrov Date: Mon, 4 Nov 2024 15:11:37 +0200 Subject: [PATCH 6/6] Standardize OS bundle name --- .../os-upgrade/os-upgrade-bundle.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/day2/system-upgrade-controller-plans/os-upgrade/os-upgrade-bundle.yaml b/bundles/day2/system-upgrade-controller-plans/os-upgrade/os-upgrade-bundle.yaml index 8e0b621..93b5b53 100644 --- a/bundles/day2/system-upgrade-controller-plans/os-upgrade/os-upgrade-bundle.yaml +++ b/bundles/day2/system-upgrade-controller-plans/os-upgrade/os-upgrade-bundle.yaml @@ -1,7 +1,7 @@ kind: Bundle apiVersion: fleet.cattle.io/v1alpha1 metadata: - name: os-upgrade-310 + name: os-upgrade namespace: fleet-default spec: resources: @@ -213,7 +213,7 @@ spec: EDGE_RELEASE_CPE: "cpe:/o:suse:sl-micro:6.0" SL_MICRO_ZYPPER_ID: "SL-Micro" SL_MICRO_VERSION: "6.0" - name: os-pkg-update-bundle.yaml + name: os-upgrade-bundle.yaml targets: # Match nothing, user needs to specify targets - clusterSelector: null