Skip to content

Commit bcc0b27

Browse files
committed
feat: scheduler constraints for controller pods
1 parent 7977592 commit bcc0b27

File tree

4 files changed

+60
-14
lines changed

4 files changed

+60
-14
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,22 @@ apiVersion: v1
3232
kind: Secret
3333
type: Opaque
3434
metadata:
35-
name: vmware-system-csi
35+
name: vsphere-csi-config-secret
3636
stringData:
3737
csi-vsphere.conf: |
3838
[Global]
39-
cluster-id = "<cluster-id>"
40-
user = "<username>"
41-
password = "<password>"
42-
port = "<port>"
43-
insecure-flag = "<insecure-flag>"
44-
[VirtualCenter "<host>"]
45-
datacenters = "<dc-1>, <dc-2>, ..."
39+
cluster-id = "cluster-namespace/cluster-name"
40+
user = "administrator@vsphere.local"
41+
password = "password"
42+
port = 443
43+
[VirtualCenter "vcenter.local"]
44+
datacenters = "datacenter-name"
45+
insecure-flag = false
4646
EOF
4747
```
4848

4949
Install the chart using Helm. You can customize the installation by providing a `my-values.yaml` file with your specific configuration.
5050

51-
5251
```bash
5352
# Add repository (if published)
5453
helm repo add clastix https://clastix.github.io/charts

charts/vsphere-csi/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ vSphere Container Storage Interface (CSI) for Kamaji Tenant Clusters
2323
|-----|------|---------|-------------|
2424
| cluster.name | string | `"roma"` | Name of the Tenant Cluster |
2525
| cluster.targetNamespace | string | `"vmware-system-csi"` | Target namespace in the Tenant Cluster where the CSI driver will be installed |
26+
| controller.additionalMetadata | object | `{"annotations":{},"labels":{}}` | Additional metadata as labels and annotations |
27+
| controller.affinity | object | `{}` | Affinity scheduling rules |
2628
| controller.csiAttacher.imagePullPolicy | string | `"IfNotPresent"` | CSI Attacher image pull policy |
2729
| controller.csiAttacher.repository | string | `"registry.k8s.io/sig-storage/csi-attacher"` | CSI Attacher image |
2830
| controller.csiAttacher.resources | object | `{}` | CSI Attacher resources |
@@ -46,10 +48,12 @@ vSphere Container Storage Interface (CSI) for Kamaji Tenant Clusters
4648
| controller.livenessProbe.repository | string | `"registry.k8s.io/sig-storage/livenessprobe"` | CSI liveness probe image |
4749
| controller.livenessProbe.resources | object | `{}` | CSI liveness probe resources |
4850
| controller.livenessProbe.tag | string | `"v2.15.0"` | CSI liveness probe image tag |
49-
| controller.nodeSelector | object | `{}` | CSI Controller Node Selector |
51+
| controller.nodeSelector | object | `{"kubernetes.io/os":"linux"}` | NodeSelector for scheduling |
52+
| controller.podAdditionalMetadata | object | `{"annotations":{},"labels":{}}` | Pods Additional metadata as labels and annotations |
5053
| controller.resources | object | `{}` | CSI Controller resources |
51-
| controller.tolerations | list | `[]` | CSI Controller Tolerations |
54+
| controller.tolerations | list | `[]` | Tolerations for scheduling |
5255
| controller.topology.enabled | bool | `false` | Enable topology feature |
56+
| controller.topologySpreadConstraints | list | `[]` | TopologySpreadConstraints for scheduling |
5357
| controller.vsphereSyncer.imagePullPolicy | string | `"IfNotPresent"` | CSI Syncer image pull policy |
5458
| controller.vsphereSyncer.repository | string | `"registry.k8s.io/csi-vsphere/syncer"` | CSI Syncer image |
5559
| controller.vsphereSyncer.resources | object | `{}` | CSI Syncer resources |

charts/vsphere-csi/templates/csi-controller-manifests.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ metadata:
2424
labels:
2525
component: csi-controller-manager
2626
cluster.x-k8s.io/cluster-name: {{ include "cluster-name" . | quote }}
27+
{{- with .Values.controller.additionalMetadata.labels }}
28+
{{- toYaml . | nindent 4 }}
29+
{{- end }}
30+
annotations:
31+
{{- with .Values.controller.additionalMetadata.annotations }}
32+
{{- toYaml . | nindent 4 }}
33+
{{- end }}
2734
name: {{ include "cluster-name" . }}-vsphere-csi-controller
2835
namespace: {{ .Release.Namespace }}
2936
spec:
@@ -42,6 +49,13 @@ spec:
4249
component: csi-controller-manager
4350
app: {{ include "cluster-name" . }}-vsphere-csi-controller
4451
role: vsphere-csi
52+
{{- with .Values.controller.podAdditionalMetadata.labels }}
53+
{{- toYaml . | nindent 8 }}
54+
{{- end }}
55+
annotations:
56+
{{- with .Values.controller.podAdditionalMetadata.annotations }}
57+
{{- toYaml . | nindent 8 }}
58+
{{- end }}
4559
spec:
4660
containers:
4761
- name: vsphere-csi-controller
@@ -289,6 +303,22 @@ spec:
289303
subPath: admin.svc
290304
dnsPolicy: ClusterFirst
291305
serviceAccountName: {{ include "cluster-name" . }}-vsphere-csi-controller
306+
affinity:
307+
{{- with .Values.controller.affinity }}
308+
{{- toYaml . | nindent 6 }}
309+
{{- end }}
310+
tolerations:
311+
{{- with .Values.controller.tolerations }}
312+
{{- toYaml . | nindent 6 }}
313+
{{- end }}
314+
nodeSelector:
315+
{{- with .Values.controller.nodeSelector }}
316+
{{- toYaml . | nindent 6 }}
317+
{{- end }}
318+
topologySpreadConstraints:
319+
{{- with .Values.controller.topologySpreadConstraints }}
320+
{{- toYaml . | nindent 6 }}
321+
{{- end }}
292322
volumes:
293323
- emptyDir: {}
294324
name: socket-dir

charts/vsphere-csi/values.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,23 @@ controller:
7676
topology:
7777
# -- Enable topology feature
7878
enabled: false
79-
# -- CSI Controller Node Selector
80-
nodeSelector: {}
81-
# -- CSI Controller Tolerations
79+
# -- Additional metadata as labels and annotations
80+
additionalMetadata:
81+
labels: {}
82+
annotations: {}
83+
# -- Pods Additional metadata as labels and annotations
84+
podAdditionalMetadata:
85+
labels: {}
86+
annotations: {}
87+
# -- Affinity scheduling rules
88+
affinity: {}
89+
# -- Tolerations for scheduling
8290
tolerations: []
91+
# -- NodeSelector for scheduling
92+
nodeSelector:
93+
kubernetes.io/os: linux
94+
# -- TopologySpreadConstraints for scheduling
95+
topologySpreadConstraints: []
8396

8497
driver:
8598
image:

0 commit comments

Comments
 (0)