Skip to content

Commit

Permalink
fix rke2 and k3s templates
Browse files Browse the repository at this point in the history
  • Loading branch information
eljohnson92 committed May 29, 2024
1 parent b722c4c commit a366377
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 85 deletions.
2 changes: 1 addition & 1 deletion docs/src/developers/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ This can then be used with `clusterctl` by adding the following to `~/.cluster-a
```
providers:
- name: local-linode
url: ${PWD}/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml
url: ${HOME}/cluster-api-provider-linode/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml
type: InfrastructureProvider
```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/developers/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ The e2e tests use the `local-linode` infrastructure provider, this is registered
```
providers:
- name: local-linode
url: ${PWD}/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml
url: ${HOME}/cluster-api-provider-linode/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml
type: InfrastructureProvider
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
--flavor k3s --kubernetes-version v1.29.1+k3s2 \
--infrastructure local-linode:v0.0.0 \
--control-plane-machine-count 1 --worker-machine-count 1 \
--config $CLUSTERCTL_CONFIG > k3s-cluster.yaml
--config ${CLUSTERCTL_CONFIG:${HOME}/.cluster-api/clusterctl.yaml} > k3s-cluster.yaml
check:
($error == null): true
- name: Apply generated cluster yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
--kubernetes-version v1.29.1 \
--infrastructure local-linode:v0.0.0 \
--control-plane-machine-count 1 --worker-machine-count 1 \
--config $CLUSTERCTL_CONFIG > default-cluster.yaml
--config ${CLUSTERCTL_CONFIG:${HOME}/.cluster-api/clusterctl.yaml} > default-cluster.yaml
check:
($error == null): true
- name: Apply generated cluster yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
--flavor rke2 --kubernetes-version v1.29.1+rke2r1 \
--infrastructure local-linode:v0.0.0 \
--control-plane-machine-count 1 --worker-machine-count 1 \
--config $CLUSTERCTL_CONFIG> rke2-cluster.yaml
--config ${CLUSTERCTL_CONFIG:${HOME}/.cluster-api/clusterctl.yaml} > rke2-cluster.yaml
check:
($error == null): true
- name: Apply generated cluster yaml
Expand Down
2 changes: 1 addition & 1 deletion e2e/gha-clusterctl-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
providers:
- name: local-linode
url: /home/runner/work/cluster-api-provider-linode/cluster-api-provider-linode/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml
url: ${GITHUB_WORKSPACE}/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml
type: InfrastructureProvider
- name: "k3s"
url: https://github.com/k3s-io/cluster-api-k3s/releases/latest/bootstrap-components.yaml
Expand Down
29 changes: 0 additions & 29 deletions templates/flavors/k3s/default/k3sControlPlane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,6 @@ spec:
content: |
flannel-backend: none
disable-network-policy: true
- path: /var/lib/rancher/k3s/server/manifests/ccm-linode.yaml
owner: root:root
content: |-
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
namespace: kube-system
name: ccm-linode
spec:
targetNamespace: kube-system
version: ${LINODE_CCM_VERSION:=v0.4.4}
chart: ccm-linode
repo: https://linode.github.io/linode-cloud-controller-manager/
bootstrap: true
valuesContent: |-
routeController:
vpcName: ${VPC_NAME:=${CLUSTER_NAME}}
clusterCIDR: 10.0.0.0/8
configureCloudRoutes: true
secretRef:
name: "linode-token-region"
nodeSelector:
node-role.kubernetes.io/control-plane: "true"
- path: /var/lib/rancher/k3s/server/manifests/cilium.yaml
owner: root:root
content: |-
Expand Down Expand Up @@ -86,12 +63,6 @@ spec:
enabled: true
ui:
enabled: true
- path: /var/lib/rancher/k3s/server/manifests/linode-token-region.yaml
owner: root:root
contentFrom:
secret:
key: linode-token-region.yaml
name: linode-${CLUSTER_NAME}-crs-0
serverConfig:
disableComponents:
- servicelb
Expand Down
17 changes: 16 additions & 1 deletion templates/flavors/k3s/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ resources:
- ../../../infra
- k3sControlPlane.yaml
- k3sConfigTemplate.yaml
- secret.yaml
- ../../../addons/cilium-network-policies
- ../../../addons/csi-driver-linode
- ../../../addons/ccm-linode
- ../../../addons/cluster-resource-set
patches:
- target:
group: cluster.x-k8s.io
Expand All @@ -15,6 +17,19 @@ patches:
- op: replace
path: /spec/controlPlaneRef/kind
value: KThreesControlPlane
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: Cluster
patch: |-
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
labels:
ccm: ${CLUSTER_NAME}-linode
csi: ${CLUSTER_NAME}-linode
crs: ${CLUSTER_NAME}-crs
- target:
group: cluster.x-k8s.io
version: v1beta1
Expand Down
9 changes: 7 additions & 2 deletions templates/flavors/rke2/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ resources:
- ../../../infra
- rke2ControlPlane.yaml
- rke2ConfigTemplate.yaml
- secret.yaml
- ../../../addons/cilium
- ../../../addons/cilium-network-policies
- ../../../addons/csi-driver-linode
- ../../../addons/ccm-linode
- ../../../addons/cluster-resource-set
patches:
- target:
group: cluster.x-k8s.io
Expand All @@ -26,7 +28,10 @@ patches:
metadata:
name: ${CLUSTER_NAME}
labels:
cni: ${CLUSTER_NAME}-cilium
cni: ${CLUSTER_NAME}-cilium
ccm: ${CLUSTER_NAME}-linode
csi: ${CLUSTER_NAME}-linode
crs: ${CLUSTER_NAME}-crs
- target:
group: cluster.x-k8s.io
version: v1beta1
Expand Down
30 changes: 0 additions & 30 deletions templates/flavors/rke2/default/rke2ControlPlane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,6 @@ spec:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeMachineTemplate
name: ${CLUSTER_NAME}-control-plane
files:
- path: /var/lib/rancher/rke2/server/manifests/ccm-linode.yaml
owner: root:root
content: |-
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
namespace: kube-system
name: ccm-linode
spec:
targetNamespace: kube-system
version: ${LINODE_CCM_VERSION:=v0.4.4}
chart: ccm-linode
repo: https://linode.github.io/linode-cloud-controller-manager/
bootstrap: true
valuesContent: |-
routeController:
vpcName: ${VPC_NAME:=${CLUSTER_NAME}}
clusterCIDR: 10.0.0.0/8
configureCloudRoutes: true
secretRef:
name: "linode-token-region"
nodeSelector:
node-role.kubernetes.io/control-plane: "true"
- contentFrom:
secret:
key: linode-token-region.yaml
name: linode-${CLUSTER_NAME}-crs-0
owner: root:root
path: /var/lib/rancher/rke2/server/manifests/linode-token-region.yaml
registrationMethod: internal-only-ips
serverConfig:
cni: none
Expand Down
17 changes: 0 additions & 17 deletions templates/flavors/rke2/default/secret.yaml

This file was deleted.

0 comments on commit a366377

Please sign in to comment.