Skip to content

Commit

Permalink
Standardize SUC Plan naming in 3.1.1 (#37)
Browse files Browse the repository at this point in the history
* K3s naming standartization

* RKE2 naming standartization

* OS naming standartization

* Rename agent plans to worker

* Rename os gitrepo to reflect correct procedure

* Standardize OS bundle name
  • Loading branch information
ipetrov117 authored and hardys committed Nov 11, 2024
1 parent 32decc1 commit 161533a
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
kind: Bundle
apiVersion: fleet.cattle.io/v1alpha1
metadata:
name: os-upgrade-310
name: os-upgrade
namespace: fleet-default
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:
# will trigger upgrade for any node that does not contain the 'node-role.kubernetes.io/control-plane' label
- {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:
Expand All @@ -41,31 +42,32 @@ 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
sleep $CHECK_INTERVAL
done
envs:
- name: MASTER_PLAN
value: "cp-os-upgrade-edge-310"
value: "os-upgrade-control-plane"
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
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
Expand All @@ -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:
Expand Down Expand Up @@ -199,16 +203,17 @@ 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"
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# 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:
# will trigger upgrade for any node that does not contain the 'node-role.kubernetes.io/control-plane' label
- {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:
Expand All @@ -32,23 +33,23 @@ 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
sleep $CHECK_INTERVAL
done
envs:
- name: MASTER_PLAN
value: "cp-os-upgrade-edge-310"
value: "os-upgrade-control-plane"
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
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
Original file line number Diff line number Diff line change
@@ -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: |
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down
File renamed without changes.

0 comments on commit 161533a

Please sign in to comment.