diff --git a/packages/rancher-vsphere-cpi/charts/questions.yaml b/packages/rancher-vsphere-cpi/charts/questions.yaml index dbef2a71d..99ff81f35 100644 --- a/packages/rancher-vsphere-cpi/charts/questions.yaml +++ b/packages/rancher-vsphere-cpi/charts/questions.yaml @@ -1,15 +1,4 @@ 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 2e4ee8e41..82d46e3bb 100644 --- a/packages/rancher-vsphere-cpi/charts/templates/vsphere-cpi-ds.yaml +++ b/packages/rancher-vsphere-cpi/charts/templates/vsphere-cpi-ds.yaml @@ -26,12 +26,23 @@ spec: {{- with .Values.cloudControllerManager.nodeSelector }} {{- toYaml . | nindent 8 }} {{- end }} - {{- 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" + {{- else }} + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + # RKE node selector label + - key: node-role.kubernetes.io/controlplane + operator: In + values: + - "true" + - matchExpressions: + # RKE2 node selector label + - key: node-role.kubernetes.io/control-plane + operator: In + values: + - "true" {{- end }} securityContext: runAsUser: 1001 diff --git a/packages/rancher-vsphere-cpi/charts/values.yaml b/packages/rancher-vsphere-cpi/charts/values.yaml index 708112e82..41e01f888 100644 --- a/packages/rancher-vsphere-cpi/charts/values.yaml +++ b/packages/rancher-vsphere-cpi/charts/values.yaml @@ -17,9 +17,6 @@ cloudControllerManager: rbac: enabled: true -# Set to "rke" or "rke2" to apply the node selector label appropriate for the cluster -clusterType: "rke" - global: cattle: systemDefaultRegistry: ""