From 2ca0f3fd85d4686202bfb8e86a2ea115adafbfd2 Mon Sep 17 00:00:00 2001 From: Rahul Sharma Date: Mon, 29 Apr 2024 15:17:05 -0400 Subject: [PATCH] generate unique helmchartproxy names (#295) Co-authored-by: Rahul Sharma --- docs/src/topics/addons.md | 12 ++++++------ docs/src/topics/flavors/clusterclass-kubeadm.md | 4 ++-- docs/src/topics/troubleshooting.md | 2 +- templates/addons/cilium/cilium-ipv6.yaml | 4 ++-- templates/addons/cilium/cilium-vxlan.yaml | 4 ++-- templates/addons/cilium/cilium.yaml | 4 ++-- templates/addons/csi-driver-linode/linode-csi.yaml | 4 ++-- .../addons/provider-linode/linode-ccm-vpcless.yaml | 4 ++-- templates/addons/provider-linode/linode-ccm.yaml | 4 ++-- .../clusterclass-kubeadm/cluster-template.yaml | 4 ++-- templates/flavors/default/kustomization.yaml | 6 +++--- templates/flavors/rke2/kustomization.yaml | 2 +- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/src/topics/addons.md b/docs/src/topics/addons.md index b29fd530c..ee23361ea 100644 --- a/docs/src/topics/addons.md +++ b/docs/src/topics/addons.md @@ -46,11 +46,11 @@ In order for pod networking to work properly, a Container Network Interface (CNI Installed by default ``` -To install [Cilium](https://cilium.io/) on a self-managed cluster, simply apply the `cni: cilium` +To install [Cilium](https://cilium.io/) on a self-managed cluster, simply apply the `cni: -cilium` label on the `Cluster` resource if not already present. ```bash -kubectl label cluster $CLUSTER_NAME cni=cilium --overwrite +kubectl label cluster $CLUSTER_NAME cni=$CLUSTER_NAME-cilium --overwrite ``` Cilium will then be automatically installed via CAAPH into the labeled cluster. @@ -71,11 +71,11 @@ Installed by default ``` To install the [linode-cloud-controller-manager (linode-ccm)](https://github.com/linode/linode-cloud-controller-manager) -on a self-managed cluster, simply apply the `ccm: linode` +on a self-managed cluster, simply apply the `ccm: -linode` label on the `Cluster` resource if not already present. ```bash -kubectl label cluster $CLUSTER_NAME ccm=linode --overwrite +kubectl label cluster $CLUSTER_NAME ccm=$CLUSTER_NAME-linode --overwrite ``` The linode-ccm will then be automatically installed via CAAPH into the labeled cluster. @@ -91,11 +91,11 @@ Installed by default ``` To install the [csi-driver-linode](https://github.com/linode/linode-blockstorage-csi-driver) -on a self-managed cluster, simply apply the `csi: linode` +on a self-managed cluster, simply apply the `csi: -linode` label on the `Cluster` resource if not already present. ```bash -kubectl label cluster $CLUSTER_NAME csi=linode --overwrite +kubectl label cluster $CLUSTER_NAME csi=$CLUSTER_NAME-linode --overwrite ``` The csi-driver-linode will then be automatically installed via CAAPH into the labeled cluster. diff --git a/docs/src/topics/flavors/clusterclass-kubeadm.md b/docs/src/topics/flavors/clusterclass-kubeadm.md index efdd7cc5b..36ecc2e50 100644 --- a/docs/src/topics/flavors/clusterclass-kubeadm.md +++ b/docs/src/topics/flavors/clusterclass-kubeadm.md @@ -30,8 +30,8 @@ kind: Cluster metadata: labels: - ccm: linode - cni: cilium + ccm: test-cluster-2-linode + cni: test-cluster-2-cilium crs: test-cluster-2-crs name: test-cluster-2 namespace: default diff --git a/docs/src/topics/troubleshooting.md b/docs/src/topics/troubleshooting.md index 8623ea886..dbab160ce 100644 --- a/docs/src/topics/troubleshooting.md +++ b/docs/src/topics/troubleshooting.md @@ -29,7 +29,7 @@ Otherwise, [ensure that the linode-ccm is installed on your workload cluster via Make sure [a CNI is installed on the workload cluster](../topics/addons.md#cni) and that all the pods on the workload cluster are in running state. -If the Cluster is labeled with `cni: cilium`, check that the cilium `HelmChartProxy` is installed in +If the Cluster is labeled with `cni: -cilium`, check that the \-cilium `HelmChartProxy` is installed in the management cluster and that the `HelmChartProxy` is in a `Ready` state: ```bash diff --git a/templates/addons/cilium/cilium-ipv6.yaml b/templates/addons/cilium/cilium-ipv6.yaml index ab6ef24b4..a99962765 100644 --- a/templates/addons/cilium/cilium-ipv6.yaml +++ b/templates/addons/cilium/cilium-ipv6.yaml @@ -1,12 +1,12 @@ apiVersion: addons.cluster.x-k8s.io/v1alpha1 kind: HelmChartProxy metadata: - name: cilium-ipv6 + name: ${CLUSTER_NAME}-cilium-ipv6 spec: clusterSelector: matchExpressions: - {key: ipv6, operator: In, values: ['true']} - - {key: cni, operator: In, values: ['cilium']} + - {key: cni, operator: In, values: ["${CLUSTER_NAME}-cilium"]} - {key: vxlan, operator: DoesNotExist} repoURL: https://helm.cilium.io/ chartName: cilium diff --git a/templates/addons/cilium/cilium-vxlan.yaml b/templates/addons/cilium/cilium-vxlan.yaml index 70d15029a..89bf86b7a 100644 --- a/templates/addons/cilium/cilium-vxlan.yaml +++ b/templates/addons/cilium/cilium-vxlan.yaml @@ -1,12 +1,12 @@ apiVersion: addons.cluster.x-k8s.io/v1alpha1 kind: HelmChartProxy metadata: - name: cilium-vxlan + name: ${CLUSTER_NAME}-cilium-vxlan spec: clusterSelector: matchExpressions: - {key: vxlan, operator: In, values: ['true']} - - {key: cni, operator: In, values: ['cilium']} + - {key: cni, operator: In, values: ["${CLUSTER_NAME}-cilium"]} - {key: ipv6, operator: DoesNotExist} repoURL: https://helm.cilium.io/ chartName: cilium diff --git a/templates/addons/cilium/cilium.yaml b/templates/addons/cilium/cilium.yaml index e7117470c..e8d3b2396 100644 --- a/templates/addons/cilium/cilium.yaml +++ b/templates/addons/cilium/cilium.yaml @@ -1,13 +1,13 @@ apiVersion: addons.cluster.x-k8s.io/v1alpha1 kind: HelmChartProxy metadata: - name: cilium + name: ${CLUSTER_NAME}-cilium spec: clusterSelector: matchExpressions: - {key: ipv6, operator: DoesNotExist} - {key: vxlan, operator: DoesNotExist} - - {key: cni, operator: In, values: ['cilium']} + - {key: cni, operator: In, values: ["${CLUSTER_NAME}-cilium"]} repoURL: https://helm.cilium.io/ chartName: cilium namespace: kube-system diff --git a/templates/addons/csi-driver-linode/linode-csi.yaml b/templates/addons/csi-driver-linode/linode-csi.yaml index e2aba53b0..102e597bb 100644 --- a/templates/addons/csi-driver-linode/linode-csi.yaml +++ b/templates/addons/csi-driver-linode/linode-csi.yaml @@ -1,11 +1,11 @@ apiVersion: addons.cluster.x-k8s.io/v1alpha1 kind: HelmChartProxy metadata: - name: csi-driver-linode + name: ${CLUSTER_NAME}-csi-driver-linode spec: clusterSelector: matchLabels: - csi: linode + csi: ${CLUSTER_NAME}-linode repoURL: https://linode.github.io/linode-blockstorage-csi-driver/ chartName: linode-blockstorage-csi-driver namespace: kube-system diff --git a/templates/addons/provider-linode/linode-ccm-vpcless.yaml b/templates/addons/provider-linode/linode-ccm-vpcless.yaml index 8ff959a66..4f0a092ef 100644 --- a/templates/addons/provider-linode/linode-ccm-vpcless.yaml +++ b/templates/addons/provider-linode/linode-ccm-vpcless.yaml @@ -1,11 +1,11 @@ apiVersion: addons.cluster.x-k8s.io/v1alpha1 kind: HelmChartProxy metadata: - name: linode-cloud-controller-manager-vpcless + name: ${CLUSTER_NAME}-linode-cloud-controller-manager-vpcless spec: clusterSelector: matchLabels: - ccm: linode + ccm: "${CLUSTER_NAME}-linode" vpcless: "true" repoURL: https://linode.github.io/linode-cloud-controller-manager/ chartName: ccm-linode diff --git a/templates/addons/provider-linode/linode-ccm.yaml b/templates/addons/provider-linode/linode-ccm.yaml index 2fe8d5464..5f42e1d6e 100644 --- a/templates/addons/provider-linode/linode-ccm.yaml +++ b/templates/addons/provider-linode/linode-ccm.yaml @@ -1,12 +1,12 @@ apiVersion: addons.cluster.x-k8s.io/v1alpha1 kind: HelmChartProxy metadata: - name: linode-cloud-controller-manager + name: ${CLUSTER_NAME}-linode-cloud-controller-manager spec: clusterSelector: matchExpressions: - {key: vpcless, operator: DoesNotExist} - - {key: ccm, operator: In, values: ['linode']} + - {key: ccm, operator: In, values: ["${CLUSTER_NAME}-linode"]} repoURL: https://linode.github.io/linode-cloud-controller-manager/ chartName: ccm-linode namespace: kube-system diff --git a/templates/flavors/clusterclass-kubeadm/cluster-template.yaml b/templates/flavors/clusterclass-kubeadm/cluster-template.yaml index 64bea6b02..d39fda42b 100644 --- a/templates/flavors/clusterclass-kubeadm/cluster-template.yaml +++ b/templates/flavors/clusterclass-kubeadm/cluster-template.yaml @@ -3,8 +3,8 @@ kind: Cluster metadata: name: ${CLUSTER_NAME} labels: - cni: cilium - ccm: linode + cni: ${CLUSTER_NAME}-cilium + ccm: ${CLUSTER_NAME}-linode crs: ${CLUSTER_NAME}-crs spec: clusterNetwork: diff --git a/templates/flavors/default/kustomization.yaml b/templates/flavors/default/kustomization.yaml index f1d01e98d..b0b3b36e3 100644 --- a/templates/flavors/default/kustomization.yaml +++ b/templates/flavors/default/kustomization.yaml @@ -28,9 +28,9 @@ patches: metadata: name: ${CLUSTER_NAME} labels: - cni: cilium - ccm: linode - csi: linode + cni: ${CLUSTER_NAME}-cilium + ccm: ${CLUSTER_NAME}-linode + csi: ${CLUSTER_NAME}-linode crs: ${CLUSTER_NAME}-crs - target: group: cluster.x-k8s.io diff --git a/templates/flavors/rke2/kustomization.yaml b/templates/flavors/rke2/kustomization.yaml index 2cc4242da..c82618b80 100644 --- a/templates/flavors/rke2/kustomization.yaml +++ b/templates/flavors/rke2/kustomization.yaml @@ -25,7 +25,7 @@ patches: metadata: name: ${CLUSTER_NAME} labels: - cni: cilium + cni: ${CLUSTER_NAME}-cilium - target: group: cluster.x-k8s.io version: v1beta1