Skip to content

Commit

Permalink
Revert "rke2 manifests fixes after upstream changes"
Browse files Browse the repository at this point in the history
This reverts commit 66c824d.
  • Loading branch information
amold1 committed May 30, 2024
1 parent 66c824d commit 7cc319b
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 22 deletions.
31 changes: 11 additions & 20 deletions templates/flavors/rke2/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ 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 @@ -28,10 +26,7 @@ patches:
metadata:
name: ${CLUSTER_NAME}
labels:
cni: ${CLUSTER_NAME}-cilium
ccm: ${CLUSTER_NAME}-linode
csi: ${CLUSTER_NAME}-linode
crs: ${CLUSTER_NAME}-crs
cni: ${CLUSTER_NAME}-cilium
- target:
group: cluster.x-k8s.io
version: v1beta1
Expand All @@ -41,17 +36,13 @@ patches:
path: /spec/template/spec/bootstrap/configRef/kind
value: RKE2ConfigTemplate
- target:
kind: HelmChartProxy
name: .*-linode-cloud-controller-manager
group: cluster.x-k8s.io
version: v1beta1
kind: Cluster
patch: |-
- op: replace
path: /spec/valuesTemplate
value: |
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"
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
labels:
cni: ${CLUSTER_NAME}-cilium
30 changes: 30 additions & 0 deletions templates/flavors/rke2/default/rke2ControlPlane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,36 @@ 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: 17 additions & 0 deletions templates/flavors/rke2/default/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: v1
kind: Secret
metadata:
labels:
clusterctl.cluster.x-k8s.io/move: "true"
name: linode-${CLUSTER_NAME}-crs-0
stringData:
linode-token-region.yaml: |-
kind: Secret
apiVersion: v1
metadata:
name: linode-token-region
namespace: kube-system
stringData:
apiToken: ${LINODE_TOKEN}
region: ${LINODE_REGION}
30 changes: 28 additions & 2 deletions templates/flavors/rke2/vpcless/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ patches:
name: "linode-token-region"
image:
pullPolicy: IfNotPresent
nodeSelector:
node-role.kubernetes.io/control-plane: "true"
- target:
kind: LinodeVPC
patch: |-
Expand Down Expand Up @@ -85,6 +83,34 @@ patches:
- sed -i '/swap/d' /etc/fstab
- swapoff -a
- hostnamectl set-hostname '{{ ds.meta_data.label }}' && hostname -F /etc/hostname
- op: replace
path: /spec/files
value:
- 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: |-
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
- target:
group: cluster.x-k8s.io
version: v1beta1
Expand Down

0 comments on commit 7cc319b

Please sign in to comment.