From 66c824d8c95da0b1b80654221d48623764e3a3de Mon Sep 17 00:00:00 2001 From: Amol Deodhar Date: Thu, 30 May 2024 14:24:08 -0400 Subject: [PATCH] rke2 manifests fixes after upstream changes --- .../flavors/rke2/default/kustomization.yaml | 31 ++++++++++++------- .../rke2/default/rke2ControlPlane.yaml | 30 ------------------ templates/flavors/rke2/default/secret.yaml | 17 ---------- .../flavors/rke2/vpcless/kustomization.yaml | 30 ++---------------- 4 files changed, 22 insertions(+), 86 deletions(-) delete mode 100644 templates/flavors/rke2/default/secret.yaml diff --git a/templates/flavors/rke2/default/kustomization.yaml b/templates/flavors/rke2/default/kustomization.yaml index 1f8448567..6f98a10bd 100644 --- a/templates/flavors/rke2/default/kustomization.yaml +++ b/templates/flavors/rke2/default/kustomization.yaml @@ -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 @@ -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 @@ -36,13 +41,17 @@ patches: path: /spec/template/spec/bootstrap/configRef/kind value: RKE2ConfigTemplate - target: - group: cluster.x-k8s.io - version: v1beta1 - kind: Cluster + kind: HelmChartProxy + name: .*-linode-cloud-controller-manager patch: |- - apiVersion: cluster.x-k8s.io/v1beta1 - kind: Cluster - metadata: - name: ${CLUSTER_NAME} - labels: - cni: ${CLUSTER_NAME}-cilium + - 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" diff --git a/templates/flavors/rke2/default/rke2ControlPlane.yaml b/templates/flavors/rke2/default/rke2ControlPlane.yaml index 506735cb3..7730885f0 100644 --- a/templates/flavors/rke2/default/rke2ControlPlane.yaml +++ b/templates/flavors/rke2/default/rke2ControlPlane.yaml @@ -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 diff --git a/templates/flavors/rke2/default/secret.yaml b/templates/flavors/rke2/default/secret.yaml deleted file mode 100644 index 04b685e1f..000000000 --- a/templates/flavors/rke2/default/secret.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -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} diff --git a/templates/flavors/rke2/vpcless/kustomization.yaml b/templates/flavors/rke2/vpcless/kustomization.yaml index 03c2df75b..7f173d8e7 100644 --- a/templates/flavors/rke2/vpcless/kustomization.yaml +++ b/templates/flavors/rke2/vpcless/kustomization.yaml @@ -33,6 +33,8 @@ patches: name: "linode-token-region" image: pullPolicy: IfNotPresent + nodeSelector: + node-role.kubernetes.io/control-plane: "true" - target: kind: LinodeVPC patch: |- @@ -83,34 +85,6 @@ 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