From 557d26eb9ce35906b185b58afcaa61ee72227861 Mon Sep 17 00:00:00 2001 From: Steven Crespo Date: Fri, 14 May 2021 12:24:03 -0700 Subject: [PATCH 1/2] Fix vsphere cpi - Add toggle to enable/disable rbac through chart values - Add question to apply node selector label based on cluster type - Update cloud controller manager labels/names to avoid conflict --- .../rancher-vsphere-cpi/charts/questions.yaml | 11 ++++++++ .../charts/templates/vsphere-cpi-ds.yaml | 28 +++++++++++-------- .../charts/templates/vsphere-cpi-rbac.yaml | 18 ++++++------ .../rancher-vsphere-cpi/charts/values.yaml | 5 ++++ 4 files changed, 42 insertions(+), 20 deletions(-) diff --git a/packages/rancher-vsphere-cpi/charts/questions.yaml b/packages/rancher-vsphere-cpi/charts/questions.yaml index 99ff81f35..dbef2a71d 100644 --- a/packages/rancher-vsphere-cpi/charts/questions.yaml +++ b/packages/rancher-vsphere-cpi/charts/questions.yaml @@ -1,4 +1,15 @@ questions: + - variable: clusterType + label: Cluster Type + description: Select the type of the cluster where vSphere CPI will be deployed + type: enum + default: "rke" + options: + - "rke" + - "rke2" + - "other" + group: Configuration + - variable: vCenter.host label: vCenter Host description: IP address or FQDN of the vCenter diff --git a/packages/rancher-vsphere-cpi/charts/templates/vsphere-cpi-ds.yaml b/packages/rancher-vsphere-cpi/charts/templates/vsphere-cpi-ds.yaml index 54f9af541..2e4ee8e41 100644 --- a/packages/rancher-vsphere-cpi/charts/templates/vsphere-cpi-ds.yaml +++ b/packages/rancher-vsphere-cpi/charts/templates/vsphere-cpi-ds.yaml @@ -5,29 +5,33 @@ metadata: annotations: scheduler.alpha.kubernetes.io/critical-pod: "" labels: - component: cloud-controller-manager + component: {{ .Chart.Name }}-cloud-controller-manager tier: control-plane - k8s-app: vsphere-cloud-controller-manager - name: vsphere-cloud-controller-manager + k8s-app: {{ .Chart.Name }}-cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} spec: selector: matchLabels: - k8s-app: vsphere-cloud-controller-manager + k8s-app: {{ .Chart.Name }}-cloud-controller-manager updateStrategy: type: RollingUpdate template: metadata: labels: - k8s-app: vsphere-cloud-controller-manager + k8s-app: {{ .Chart.Name }}-cloud-controller-manager spec: - nodeSelector: {{- if .Values.cloudControllerManager.nodeSelector }} + nodeSelector: {{- with .Values.cloudControllerManager.nodeSelector }} {{- toYaml . | nindent 8 }} {{- end }} - {{- else }} + {{- else if eq .Values.clusterType "rke" }} + nodeSelector: node-role.kubernetes.io/controlplane: "true" + {{- else if eq .Values.clusterType "rke2" }} + nodeSelector: + node-role.kubernetes.io/control-plane: "true" {{- end }} securityContext: runAsUser: 1001 @@ -36,9 +40,9 @@ spec: operator: Exists - effect: NoSchedule operator: Exists - serviceAccountName: cloud-controller-manager + serviceAccountName: {{ .Chart.Name }}-cloud-controller-manager containers: - - name: vsphere-cloud-controller-manager + - name: {{ .Chart.Name }}-cloud-controller-manager image: "{{ template "system_default_registry" . }}{{ .Values.cloudControllerManager.image.repository }}:{{ .Values.cloudControllerManager.image.tag }}" args: - --v=2 @@ -61,8 +65,8 @@ apiVersion: v1 kind: Service metadata: labels: - component: cloud-controller-manager - name: vsphere-cloud-controller-manager + component: {{ .Chart.Name }}-cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} spec: type: NodePort @@ -71,4 +75,4 @@ spec: protocol: TCP targetPort: 43001 selector: - component: cloud-controller-manager + component: {{ .Chart.Name }}-cloud-controller-manager diff --git a/packages/rancher-vsphere-cpi/charts/templates/vsphere-cpi-rbac.yaml b/packages/rancher-vsphere-cpi/charts/templates/vsphere-cpi-rbac.yaml index 56b8fa64c..4330af276 100644 --- a/packages/rancher-vsphere-cpi/charts/templates/vsphere-cpi-rbac.yaml +++ b/packages/rancher-vsphere-cpi/charts/templates/vsphere-cpi-rbac.yaml @@ -1,14 +1,15 @@ +{{- if .Values.cloudControllerManager.rbac.enabled -}} # Source: https://github.com/kubernetes/cloud-provider-vsphere/blob/master/releases/v1.19/vsphere-cloud-controller-manager.yaml apiVersion: v1 kind: ServiceAccount metadata: - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager rules: - apiGroups: - "" @@ -105,23 +106,24 @@ roleRef: subjects: - apiGroup: "" kind: ServiceAccount - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} - apiGroup: "" kind: User - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager subjects: - kind: ServiceAccount - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} - kind: User - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager +{{- end -}} diff --git a/packages/rancher-vsphere-cpi/charts/values.yaml b/packages/rancher-vsphere-cpi/charts/values.yaml index 4c297fd40..708112e82 100644 --- a/packages/rancher-vsphere-cpi/charts/values.yaml +++ b/packages/rancher-vsphere-cpi/charts/values.yaml @@ -14,6 +14,11 @@ cloudControllerManager: repository: rancher/mirrored-cloud-provider-vsphere-cpi-release-manager tag: v1.2.1 nodeSelector: {} + rbac: + enabled: true + +# Set to "rke" or "rke2" to apply the node selector label appropriate for the cluster +clusterType: "rke" global: cattle: From d7c8735983564c8d5bece064bfd95f459eedd19a Mon Sep 17 00:00:00 2001 From: Steven Crespo Date: Wed, 30 Jun 2021 11:59:21 -0700 Subject: [PATCH 2/2] Make charts --- .../rancher-vsphere-cpi-100.0.0.tgz | Bin 3597 -> 3756 bytes .../100.0.0/questions.yaml | 11 +++++++ .../100.0.0/templates/vsphere-cpi-ds.yaml | 28 ++++++++++-------- .../100.0.0/templates/vsphere-cpi-rbac.yaml | 18 ++++++----- .../rancher-vsphere-cpi/100.0.0/values.yaml | 5 ++++ 5 files changed, 42 insertions(+), 20 deletions(-) diff --git a/assets/rancher-vsphere-cpi/rancher-vsphere-cpi-100.0.0.tgz b/assets/rancher-vsphere-cpi/rancher-vsphere-cpi-100.0.0.tgz index 2541f5a61cc6d9c86a9a7a5aeeedc6ef96331b6b..2cd21b4b72925d41962633a142c88ddff21cfc91 100644 GIT binary patch delta 3732 zcmV;F4r}p^9IPFXJb!C*+c=W>di)h#@?0gk38{x=XHI9kF5@^k*K8c0oy^qM)K(0U zEeU4`U;t2#F7bcg!b>7)`t3NgRl>lnnjy9uIPEs7eX)(lD&6UP!<4~anz$h=iG`^L{kSGkxE`>NEIsF}_qJj@# z){RJ>FMf8DPJhygGE}LgxppH0!b}ty97-{x8A{ma8s&(j2+wv8_n${JHG?Nw=W5Vy zr{(*HBU3RDkg0It#hotK-Py8d79uCMg}W3<^W8XaeJ|3oM~ zfL1F4$c5Ac==awn0Lm4ng~T_Ej0e!_n)eyeB()QjpHV23P8&G@L@A@}{LfTkhFnv^ z)G?+KwSQSJD6>{c_F^+qwd~t5a+E~l0JJPHimayE6n zR0}y@=*9MwN+~2}akH+o>jpzIbxcc$EB=L z8fE1F|1i%D*9_z+8Z$8@%$sh_JQtijeT^ehFnxq$s(2jrukQc7?DxB?^Zyv_>(>}E98r$Ya#Hgtb7J#Jdbw#qe10C8fpi4P z?|;rXIJpa+Sfjixrsa}yJ%ZN1t9I*70FWtM{AexlL7rWB{?QEm7i(9a|3$A=oT=a= zI*!xnEnS0a?SDP~>-GBUz18`Dj8+SiPASg@uxmH^9m%69YGRE2U=ezhMZtIaNbc)b zNRFHtO%6ggoS#PlfS0DkOdh~DYpMQxYk&2?Kb+aJzJU$qVB5m;%EEgo$pt?mv17l% z=R#<^Rt=29Vfzx?YV(ZO)4Z;IQyU%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XM*C6ESi#x$y>K~f@H7SR;Hj=3-e{8FoT+2o~S)m-zB{{;X5|NpC6`%C~%007KW1PA~C diff --git a/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/questions.yaml b/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/questions.yaml index 99ff81f35..dbef2a71d 100644 --- a/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/questions.yaml +++ b/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/questions.yaml @@ -1,4 +1,15 @@ questions: + - variable: clusterType + label: Cluster Type + description: Select the type of the cluster where vSphere CPI will be deployed + type: enum + default: "rke" + options: + - "rke" + - "rke2" + - "other" + group: Configuration + - variable: vCenter.host label: vCenter Host description: IP address or FQDN of the vCenter diff --git a/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/templates/vsphere-cpi-ds.yaml b/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/templates/vsphere-cpi-ds.yaml index 54f9af541..2e4ee8e41 100644 --- a/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/templates/vsphere-cpi-ds.yaml +++ b/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/templates/vsphere-cpi-ds.yaml @@ -5,29 +5,33 @@ metadata: annotations: scheduler.alpha.kubernetes.io/critical-pod: "" labels: - component: cloud-controller-manager + component: {{ .Chart.Name }}-cloud-controller-manager tier: control-plane - k8s-app: vsphere-cloud-controller-manager - name: vsphere-cloud-controller-manager + k8s-app: {{ .Chart.Name }}-cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} spec: selector: matchLabels: - k8s-app: vsphere-cloud-controller-manager + k8s-app: {{ .Chart.Name }}-cloud-controller-manager updateStrategy: type: RollingUpdate template: metadata: labels: - k8s-app: vsphere-cloud-controller-manager + k8s-app: {{ .Chart.Name }}-cloud-controller-manager spec: - nodeSelector: {{- if .Values.cloudControllerManager.nodeSelector }} + nodeSelector: {{- with .Values.cloudControllerManager.nodeSelector }} {{- toYaml . | nindent 8 }} {{- end }} - {{- else }} + {{- else if eq .Values.clusterType "rke" }} + nodeSelector: node-role.kubernetes.io/controlplane: "true" + {{- else if eq .Values.clusterType "rke2" }} + nodeSelector: + node-role.kubernetes.io/control-plane: "true" {{- end }} securityContext: runAsUser: 1001 @@ -36,9 +40,9 @@ spec: operator: Exists - effect: NoSchedule operator: Exists - serviceAccountName: cloud-controller-manager + serviceAccountName: {{ .Chart.Name }}-cloud-controller-manager containers: - - name: vsphere-cloud-controller-manager + - name: {{ .Chart.Name }}-cloud-controller-manager image: "{{ template "system_default_registry" . }}{{ .Values.cloudControllerManager.image.repository }}:{{ .Values.cloudControllerManager.image.tag }}" args: - --v=2 @@ -61,8 +65,8 @@ apiVersion: v1 kind: Service metadata: labels: - component: cloud-controller-manager - name: vsphere-cloud-controller-manager + component: {{ .Chart.Name }}-cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} spec: type: NodePort @@ -71,4 +75,4 @@ spec: protocol: TCP targetPort: 43001 selector: - component: cloud-controller-manager + component: {{ .Chart.Name }}-cloud-controller-manager diff --git a/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/templates/vsphere-cpi-rbac.yaml b/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/templates/vsphere-cpi-rbac.yaml index 56b8fa64c..4330af276 100644 --- a/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/templates/vsphere-cpi-rbac.yaml +++ b/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/templates/vsphere-cpi-rbac.yaml @@ -1,14 +1,15 @@ +{{- if .Values.cloudControllerManager.rbac.enabled -}} # Source: https://github.com/kubernetes/cloud-provider-vsphere/blob/master/releases/v1.19/vsphere-cloud-controller-manager.yaml apiVersion: v1 kind: ServiceAccount metadata: - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager rules: - apiGroups: - "" @@ -105,23 +106,24 @@ roleRef: subjects: - apiGroup: "" kind: ServiceAccount - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} - apiGroup: "" kind: User - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager subjects: - kind: ServiceAccount - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} - kind: User - name: cloud-controller-manager + name: {{ .Chart.Name }}-cloud-controller-manager +{{- end -}} diff --git a/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/values.yaml b/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/values.yaml index 4c297fd40..708112e82 100644 --- a/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/values.yaml +++ b/charts/rancher-vsphere-cpi/rancher-vsphere-cpi/100.0.0/values.yaml @@ -14,6 +14,11 @@ cloudControllerManager: repository: rancher/mirrored-cloud-provider-vsphere-cpi-release-manager tag: v1.2.1 nodeSelector: {} + rbac: + enabled: true + +# Set to "rke" or "rke2" to apply the node selector label appropriate for the cluster +clusterType: "rke" global: cattle: