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

Fix rke2 cluster class #80

Merged
merged 2 commits into from
Jul 29, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -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"

11 changes: 10 additions & 1 deletion infrastructure-elemental/v0.0.0/clusterclass-rke2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ spec:
openAPIV3Schema:
type: string
default: "eth0"
- name: k8sVersion
required: true
schema:
openAPIV3Schema:
type: string
patches:
- name: elementalClusterTemplate
definitions:
Expand All @@ -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: |
Expand Down
58 changes: 28 additions & 30 deletions test/scripts/apply_all_templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Loading