From 193263e81f8715cac772748cb17169502601124c Mon Sep 17 00:00:00 2001 From: Andrea Mazzotti Date: Wed, 24 Jul 2024 16:56:14 +0200 Subject: [PATCH 1/2] Update RKE2 Cluster Class Signed-off-by: Andrea Mazzotti --- .../v0.0.0/cluster-template-rke2-clusterclass.yaml | 2 ++ .../v0.0.0/clusterclass-rke2.yaml | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/infrastructure-elemental/v0.0.0/cluster-template-rke2-clusterclass.yaml b/infrastructure-elemental/v0.0.0/cluster-template-rke2-clusterclass.yaml index 62770dab..5a1f3827 100644 --- a/infrastructure-elemental/v0.0.0/cluster-template-rke2-clusterclass.yaml +++ b/infrastructure-elemental/v0.0.0/cluster-template-rke2-clusterclass.yaml @@ -31,4 +31,6 @@ spec: value: ${CONTROL_PLANE_ENDPOINT_PORT:=6443} - name: vipInterface value: ${VIP_INTERFACE:=eth0} + - name: k8sVersion + value: "v${KUBERNETES_VERSION:=1.30.1}+rke2r1" diff --git a/infrastructure-elemental/v0.0.0/clusterclass-rke2.yaml b/infrastructure-elemental/v0.0.0/clusterclass-rke2.yaml index 7ccef83d..5449a775 100644 --- a/infrastructure-elemental/v0.0.0/clusterclass-rke2.yaml +++ b/infrastructure-elemental/v0.0.0/clusterclass-rke2.yaml @@ -50,6 +50,11 @@ spec: openAPIV3Schema: type: string default: "eth0" + - name: k8sVersion + required: true + schema: + openAPIV3Schema: + type: string patches: - name: elementalClusterTemplate definitions: @@ -76,7 +81,11 @@ spec: controlPlane: true jsonPatches: - op: add - path: "/spec/template/spec/kubeadmConfigSpec/files" + path: "/spec/template/spec/version" + valueFrom: + variable: k8sVersion + - op: add + path: "/spec/template/spec/files" valueFrom: template: | - content: | From 759eef877abedc1d75ed0075aaa4f2b35b8be3e5 Mon Sep 17 00:00:00 2001 From: Andrea Mazzotti Date: Wed, 24 Jul 2024 17:00:09 +0200 Subject: [PATCH 2/2] Actualize test all templates script Signed-off-by: Andrea Mazzotti --- test/scripts/apply_all_templates.sh | 58 ++++++++++++++--------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/test/scripts/apply_all_templates.sh b/test/scripts/apply_all_templates.sh index 01d66ca7..1d56264d 100755 --- a/test/scripts/apply_all_templates.sh +++ b/test/scripts/apply_all_templates.sh @@ -68,21 +68,20 @@ k3s > $MANIFEST_K3S kubectl create namespace $MANIFEST_K3S_NAMESPACE kubectl apply -f $MANIFEST_K3S -## k3s clusterclass not supported upstream yet -# printf "\n##### k3s-clusterclass #####\n" -# MANIFEST_K3S_CLUSTERCLASS="$MANIFESTS_DIR/k3s-clusterclass.yaml" -# MANIFEST_K3S_CLUSTERCLASS_NAMESPACE="k3s-clusterclass" -# kubectl delete namespace $MANIFEST_K3S_CLUSTERCLASS_NAMESPACE --ignore-not-found -# clusterctl generate cluster --config $CONFIG_FILE \ -# --control-plane-machine-count=1 \ -# --worker-machine-count=1 \ -# --infrastructure elemental:$PROVIDER_VERSION \ -# --target-namespace $MANIFEST_K3S_CLUSTERCLASS_NAMESPACE \ -# --flavor k3s-clusterclass \ -# --v $LOG_LEVEL \ -# k3s-clusterclass > $MANIFEST_K3S_CLUSTERCLASS -# kubectl create namespace $MANIFEST_K3S_CLUSTERCLASS_NAMESPACE -# kubectl apply -f $MANIFEST_K3S_CLUSTERCLASS +printf "\n##### k3s-clusterclass #####\n" +MANIFEST_K3S_CLUSTERCLASS="$MANIFESTS_DIR/k3s-clusterclass.yaml" +MANIFEST_K3S_CLUSTERCLASS_NAMESPACE="k3s-clusterclass" +kubectl delete namespace $MANIFEST_K3S_CLUSTERCLASS_NAMESPACE --ignore-not-found +clusterctl generate cluster --config $CONFIG_FILE \ +--control-plane-machine-count=1 \ +--worker-machine-count=1 \ +--infrastructure elemental:$PROVIDER_VERSION \ +--target-namespace $MANIFEST_K3S_CLUSTERCLASS_NAMESPACE \ +--flavor k3s-clusterclass \ +--v $LOG_LEVEL \ +k3s-clusterclass > $MANIFEST_K3S_CLUSTERCLASS +kubectl create namespace $MANIFEST_K3S_CLUSTERCLASS_NAMESPACE +kubectl apply -f $MANIFEST_K3S_CLUSTERCLASS # rke2 printf "\n##### rke2 #####\n" @@ -100,21 +99,20 @@ rke2 > $MANIFEST_RKE2 kubectl create namespace $MANIFEST_RKE2_NAMESPACE kubectl apply -f $MANIFEST_RKE2 -# rke2 clusterclass not supported upstream yet -# printf "\n##### rke2-clusterclass #####\n" -# MANIFEST_RKE2_CLUSTERCLASS="$MANIFESTS_DIR/rke2-clusterclass.yaml" -# MANIFEST_RKE2_CLUSTERCLASS_NAMESPACE="rke2-clusterclass" -# kubectl delete namespace $MANIFEST_RKE2_CLUSTERCLASS_NAMESPACE --ignore-not-found -# clusterctl generate cluster --config $CONFIG_FILE \ -# --control-plane-machine-count=1 \ -# --worker-machine-count=1 \ -# --infrastructure elemental:$PROVIDER_VERSION \ -# --target-namespace $MANIFEST_RKE2_CLUSTERCLASS_NAMESPACE \ -# --flavor rke2-clusterclass \ -# --v $LOG_LEVEL \ -# rke2-clusterclass > $MANIFEST_RKE2_CLUSTERCLASS -# kubectl create namespace $MANIFEST_RKE2_CLUSTERCLASS_NAMESPACE -# kubectl apply -f $MANIFEST_RKE2_CLUSTERCLASS +printf "\n##### rke2-clusterclass #####\n" +MANIFEST_RKE2_CLUSTERCLASS="$MANIFESTS_DIR/rke2-clusterclass.yaml" +MANIFEST_RKE2_CLUSTERCLASS_NAMESPACE="rke2-clusterclass" +kubectl delete namespace $MANIFEST_RKE2_CLUSTERCLASS_NAMESPACE --ignore-not-found +clusterctl generate cluster --config $CONFIG_FILE \ +--control-plane-machine-count=1 \ +--worker-machine-count=1 \ +--infrastructure elemental:$PROVIDER_VERSION \ +--target-namespace $MANIFEST_RKE2_CLUSTERCLASS_NAMESPACE \ +--flavor rke2-clusterclass \ +--v $LOG_LEVEL \ +rke2-clusterclass > $MANIFEST_RKE2_CLUSTERCLASS +kubectl create namespace $MANIFEST_RKE2_CLUSTERCLASS_NAMESPACE +kubectl apply -f $MANIFEST_RKE2_CLUSTERCLASS # kubeadm printf "\n##### kubeadm #####\n"