Make charts

pull/1220/head
Steven Crespo 2021-06-30 11:59:21 -07:00
parent 557d26eb9c
commit d7c8735983
5 changed files with 42 additions and 20 deletions

View File

@ -1,4 +1,15 @@
questions: 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 - variable: vCenter.host
label: vCenter Host label: vCenter Host
description: IP address or FQDN of the vCenter description: IP address or FQDN of the vCenter

View File

@ -5,29 +5,33 @@ metadata:
annotations: annotations:
scheduler.alpha.kubernetes.io/critical-pod: "" scheduler.alpha.kubernetes.io/critical-pod: ""
labels: labels:
component: cloud-controller-manager component: {{ .Chart.Name }}-cloud-controller-manager
tier: control-plane tier: control-plane
k8s-app: vsphere-cloud-controller-manager k8s-app: {{ .Chart.Name }}-cloud-controller-manager
name: vsphere-cloud-controller-manager name: {{ .Chart.Name }}-cloud-controller-manager
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
spec: spec:
selector: selector:
matchLabels: matchLabels:
k8s-app: vsphere-cloud-controller-manager k8s-app: {{ .Chart.Name }}-cloud-controller-manager
updateStrategy: updateStrategy:
type: RollingUpdate type: RollingUpdate
template: template:
metadata: metadata:
labels: labels:
k8s-app: vsphere-cloud-controller-manager k8s-app: {{ .Chart.Name }}-cloud-controller-manager
spec: spec:
nodeSelector:
{{- if .Values.cloudControllerManager.nodeSelector }} {{- if .Values.cloudControllerManager.nodeSelector }}
nodeSelector:
{{- with .Values.cloudControllerManager.nodeSelector }} {{- with .Values.cloudControllerManager.nodeSelector }}
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- else }} {{- else if eq .Values.clusterType "rke" }}
nodeSelector:
node-role.kubernetes.io/controlplane: "true" node-role.kubernetes.io/controlplane: "true"
{{- else if eq .Values.clusterType "rke2" }}
nodeSelector:
node-role.kubernetes.io/control-plane: "true"
{{- end }} {{- end }}
securityContext: securityContext:
runAsUser: 1001 runAsUser: 1001
@ -36,9 +40,9 @@ spec:
operator: Exists operator: Exists
- effect: NoSchedule - effect: NoSchedule
operator: Exists operator: Exists
serviceAccountName: cloud-controller-manager serviceAccountName: {{ .Chart.Name }}-cloud-controller-manager
containers: 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 }}" image: "{{ template "system_default_registry" . }}{{ .Values.cloudControllerManager.image.repository }}:{{ .Values.cloudControllerManager.image.tag }}"
args: args:
- --v=2 - --v=2
@ -61,8 +65,8 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
labels: labels:
component: cloud-controller-manager component: {{ .Chart.Name }}-cloud-controller-manager
name: vsphere-cloud-controller-manager name: {{ .Chart.Name }}-cloud-controller-manager
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
spec: spec:
type: NodePort type: NodePort
@ -71,4 +75,4 @@ spec:
protocol: TCP protocol: TCP
targetPort: 43001 targetPort: 43001
selector: selector:
component: cloud-controller-manager component: {{ .Chart.Name }}-cloud-controller-manager

View File

@ -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 # Source: https://github.com/kubernetes/cloud-provider-vsphere/blob/master/releases/v1.19/vsphere-cloud-controller-manager.yaml
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: cloud-controller-manager name: {{ .Chart.Name }}-cloud-controller-manager
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
--- ---
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole kind: ClusterRole
metadata: metadata:
name: cloud-controller-manager name: {{ .Chart.Name }}-cloud-controller-manager
rules: rules:
- apiGroups: - apiGroups:
- "" - ""
@ -105,23 +106,24 @@ roleRef:
subjects: subjects:
- apiGroup: "" - apiGroup: ""
kind: ServiceAccount kind: ServiceAccount
name: cloud-controller-manager name: {{ .Chart.Name }}-cloud-controller-manager
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
- apiGroup: "" - apiGroup: ""
kind: User kind: User
name: cloud-controller-manager name: {{ .Chart.Name }}-cloud-controller-manager
--- ---
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
metadata: metadata:
name: cloud-controller-manager name: {{ .Chart.Name }}-cloud-controller-manager
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: ClusterRole kind: ClusterRole
name: cloud-controller-manager name: {{ .Chart.Name }}-cloud-controller-manager
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: cloud-controller-manager name: {{ .Chart.Name }}-cloud-controller-manager
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
- kind: User - kind: User
name: cloud-controller-manager name: {{ .Chart.Name }}-cloud-controller-manager
{{- end -}}

View File

@ -14,6 +14,11 @@ cloudControllerManager:
repository: rancher/mirrored-cloud-provider-vsphere-cpi-release-manager repository: rancher/mirrored-cloud-provider-vsphere-cpi-release-manager
tag: v1.2.1 tag: v1.2.1
nodeSelector: {} nodeSelector: {}
rbac:
enabled: true
# Set to "rke" or "rke2" to apply the node selector label appropriate for the cluster
clusterType: "rke"
global: global:
cattle: cattle: