Skip to content

Commit

Permalink
use different k8s version vars for different flavors (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
AshleyDumaine authored Feb 29, 2024
1 parent 4748538 commit e633152
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/src/topics/flavors/k3s.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* [Quickstart](../topics/getting-started.md) completed
* Select a [k3s kubernetes version](https://github.com/k3s-io/k3s/releases) to set for the kubernetes version
```bash
export KUBERNETES_VERSION=v1.29.1+k3s2
export K3S_KUBERNETES_VERSION=v1.29.1+k3s2
```
* Installed [k3s bootstrap provider](https://github.com/k3s-io/cluster-api-k3s) into your management cluster
* Add the following to `~/.cluster-api/clusterctl.yaml` for the k3s bootstrap/control plane providers
Expand Down
2 changes: 1 addition & 1 deletion docs/src/topics/flavors/rke2.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* [Quickstart](../topics/getting-started.md) completed
* Select an [rke2 kubernetes version](https://github.com/rancher/rke2/releases) to set for the kubernetes version
```bash
export KUBERNETES_VERSION=v1.29.1+rke2r1
export RKE2_KUBERNETES_VERSION=v1.29.1+rke2r1
```
* Installed [rke2 bootstrap provider](https://github.com/rancher-sandbox/cluster-api-provider-rke2) into your management cluster
```shell
Expand Down
2 changes: 1 addition & 1 deletion templates/flavors/k3s/k3sControlPlane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ spec:
- sed -i '/swap/d' /etc/fstab
- swapoff -a
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
version: ${KUBERNETES_VERSION}
version: ${K3S_KUBERNETES_VERSION}
8 changes: 8 additions & 0 deletions templates/flavors/k3s/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ patches:
- op: replace
path: /spec/template/spec/bootstrap/configRef/kind
value: KThreesConfigTemplate
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: MachineDeployment
patch: |-
- op: replace
path: /spec/template/spec/version
value: ${K3S_KUBERNETES_VERSION}
8 changes: 8 additions & 0 deletions templates/flavors/rke2/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ patches:
- op: replace
path: /spec/template/spec/bootstrap/configRef/kind
value: RKE2ConfigTemplate
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: MachineDeployment
patch: |-
- op: replace
path: /spec/template/spec/version
value: ${RKE2_KUBERNETES_VERSION}
2 changes: 1 addition & 1 deletion templates/flavors/rke2/rke2ConfigTemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
template:
spec:
agentConfig:
version: ${KUBERNETES_VERSION}
version: ${RKE2_KUBERNETES_VERSION}
nodeName: '{{ ds.meta_data.label }}'
kubelet:
extraArgs:
Expand Down
2 changes: 1 addition & 1 deletion templates/flavors/rke2/rke2ControlPlane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
kubernetesComponents:
- "cloudController"
agentConfig:
version: ${KUBERNETES_VERSION}
version: ${RKE2_KUBERNETES_VERSION}
nodeName: '{{ ds.meta_data.label }}'
kubelet:
extraArgs:
Expand Down

0 comments on commit e633152

Please sign in to comment.