Skip to content

Commit 34186f4

Browse files
authored
Merge pull request #1 from artifactsystems/vcenter
Add vsphere-csi support for RTXStack
2 parents 4a413f8 + 9faebbd commit 34186f4

21 files changed

Lines changed: 1247 additions & 0 deletions

charts/vsphere-csi/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/vsphere-csi/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: vsphere-csi
3+
description: A Helm chart for vSphere CSI Driver
4+
type: application
5+
version: 0.2.0
6+
appVersion: "2.7.0"

charts/vsphere-csi/README.md

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
# vSphere CSI Driver Helm Chart
2+
3+
vSphere Container Storage Interface (CSI) driver for Kubernetes. This Helm chart deploys all required components to enable vSphere storage integration in your Kubernetes cluster.
4+
5+
## Components
6+
7+
| Component | Type | Description |
8+
|-----------|------|-------------|
9+
| CSIDriver | CSIDriver | Registers `csi.vsphere.vmware.com` driver |
10+
| Controller | Deployment | CSI controller with attacher, resizer, provisioner, snapshotter, syncer sidecars |
11+
| Node (Linux) | DaemonSet | CSI node plugin for Linux nodes |
12+
| Node (Windows) | DaemonSet | CSI node plugin for Windows nodes (disabled by default) |
13+
| StorageClass | StorageClass | Default StorageClass for vSphere volumes |
14+
| RBAC | ClusterRole, Role, Bindings | Required permissions for controller and node |
15+
| Feature States | ConfigMap | Internal feature flags |
16+
17+
## Compatibility
18+
19+
> **Note:** CSI driver v2.7.0 is the **last version** that supports vCenter 6.7. Later CSI versions (v3.x+) require vCenter 7.0 or above.
20+
21+
| Component | Supported Versions |
22+
|-----------|-------------------|
23+
| vCenter Server | 6.7 U3, 7.0, 7.0 U1/U2/U3, 8.0 |
24+
| ESXi | 6.7 U3+, 7.0+ |
25+
| Kubernetes | 1.22 – 1.26 |
26+
| CSI Driver | v2.7.0 |
27+
28+
### vCenter 6.7 Specific Notes
29+
30+
- vCenter 6.7 **Update 3** or later is required (earlier 6.7 versions are not supported)
31+
- `insecure-flag` must be set to `"true"` if the vCenter uses a self-signed certificate
32+
- Some features may have limited functionality on vCenter 6.7:
33+
- Volume snapshots require vCenter 7.0+
34+
- Topology-aware provisioning requires vCenter 7.0+
35+
- If running on vCenter 6.7, it is recommended to set the following feature states in `values.yaml`:
36+
```yaml
37+
featureStates:
38+
block-volume-snapshot: "false" # snapshots not supported on 6.7
39+
improved-volume-topology: "false" # limited topology support on 6.7
40+
```
41+
42+
## Prerequisites
43+
44+
- Kubernetes 1.22+
45+
- Helm 3.x
46+
- VMware vCenter 6.7 U3+ or 7.0+
47+
- ESXi 6.7 U3+ or 7.0+
48+
- vCenter credentials
49+
50+
## Installation
51+
52+
### 1. Configure vSphere Connection
53+
54+
The chart automatically creates the `vsphere-config-secret` from `values.yaml`. Edit the `vSphereConfig` section with your vCenter credentials:
55+
56+
```yaml
57+
vSphereConfig:
58+
global:
59+
clusterID: "my-cluster"
60+
clusterDistribution: "my-cluster"
61+
vcenter:
62+
server: "vcenter.example.com"
63+
insecureFlag: "true"
64+
user: "administrator@vsphere.local"
65+
password: "your-password"
66+
port: "443"
67+
datacenters: "your-datacenter"
68+
```
69+
70+
This will generate the following `csi-vsphere.conf` inside the secret:
71+
72+
```ini
73+
[Global]
74+
cluster-id = "my-cluster"
75+
cluster-distribution = "my-cluster"
76+
77+
[VirtualCenter "vcenter.example.com"]
78+
insecure-flag = "true"
79+
user = "administrator@vsphere.local"
80+
password = "your-password"
81+
port = "443"
82+
datacenters = "your-datacenter"
83+
```
84+
85+
### 2. Install the Chart
86+
87+
```bash
88+
helm install vsphere-csi ./vsphere-csi -n vmware-system-csi --create-namespace
89+
```
90+
91+
Or with custom values:
92+
93+
```bash
94+
helm install vsphere-csi ./vsphere-csi -n vmware-system-csi -f my-values.yaml
95+
```
96+
97+
## Uninstallation
98+
99+
```bash
100+
helm uninstall vsphere-csi -n vmware-system-csi
101+
```
102+
103+
## Configuration
104+
105+
### vSphere Connection
106+
107+
| Parameter | Description | Default |
108+
|-----------|-------------|---------|
109+
| `vSphereConfig.global.clusterID` | Cluster identifier | `art-asd` |
110+
| `vSphereConfig.global.clusterDistribution` | Cluster distribution name | `art-asd` |
111+
| `vSphereConfig.vcenter.server` | vCenter FQDN or IP | `vcenter.asd.com` |
112+
| `vSphereConfig.vcenter.insecureFlag` | Skip TLS certificate verification | `true` |
113+
| `vSphereConfig.vcenter.user` | vCenter username | `administrator@vsphere.local` |
114+
| `vSphereConfig.vcenter.password` | vCenter password | `asdasd` |
115+
| `vSphereConfig.vcenter.port` | vCenter port | `443` |
116+
| `vSphereConfig.vcenter.datacenters` | Datacenter name(s) | `asdasd` |
117+
118+
### General
119+
120+
| Parameter | Description | Default |
121+
|-----------|-------------|---------|
122+
| `namespace` | Target namespace | `vmware-system-csi` |
123+
124+
### CSI Driver
125+
126+
| Parameter | Description | Default |
127+
|-----------|-------------|---------|
128+
| `csiDriver.name` | CSI driver name | `csi.vsphere.vmware.com` |
129+
| `csiDriver.attachRequired` | Whether attach is required | `true` |
130+
| `csiDriver.podInfoOnMount` | Inject pod info on mount | `false` |
131+
132+
### Controller
133+
134+
| Parameter | Description | Default |
135+
|-----------|-------------|---------|
136+
| `controller.replicas` | Number of controller replicas | `1` |
137+
| `controller.nodeSelector` | Controller node selector | `{}` |
138+
| `controller.tolerations` | Controller tolerations | master, control-plane, etcd |
139+
| `controller.dnsPolicy` | DNS policy | `Default` |
140+
| `controller.driver.image.repository` | Controller driver image | `rancher/mirrored-cloud-provider-vsphere-csi-release-driver` |
141+
| `controller.driver.image.tag` | Controller driver image tag | `v2.7.0` |
142+
| `controller.driver.loggerLevel` | Log level (PRODUCTION/DEVELOPMENT) | `PRODUCTION` |
143+
| `controller.syncer.image.repository` | Syncer image | `rancher/mirrored-cloud-provider-vsphere-csi-release-syncer` |
144+
| `controller.syncer.image.tag` | Syncer image tag | `v2.7.0` |
145+
| `controller.syncer.fullSyncIntervalMinutes` | Full sync interval | `30` |
146+
| `controller.vSphereConfigSecret` | Name of vSphere config secret | `vsphere-config-secret` |
147+
148+
### Controller Sidecars
149+
150+
| Parameter | Description | Default |
151+
|-----------|-------------|---------|
152+
| `controller.sidecars.attacher.image.tag` | CSI attacher tag | `v3.5.0` |
153+
| `controller.sidecars.resizer.image.tag` | CSI resizer tag | `v1.5.0` |
154+
| `controller.sidecars.provisioner.image.tag` | CSI provisioner tag | `v3.2.1` |
155+
| `controller.sidecars.snapshotter.image.tag` | CSI snapshotter tag | `v6.0.1` |
156+
| `controller.sidecars.livenessProbe.image.tag` | Liveness probe tag | `v2.7.0` |
157+
158+
### Node (Linux)
159+
160+
| Parameter | Description | Default |
161+
|-----------|-------------|---------|
162+
| `node.enabled` | Enable Linux node DaemonSet | `true` |
163+
| `node.hostNetwork` | Use host networking | `true` |
164+
| `node.maxVolumesPerNode` | Max volumes per node | `59` |
165+
| `node.driver.image.tag` | Node driver image tag | `v2.7.0` |
166+
| `node.driver.loggerLevel` | Log level | `PRODUCTION` |
167+
168+
### Node (Windows)
169+
170+
| Parameter | Description | Default |
171+
|-----------|-------------|---------|
172+
| `nodeWindows.enabled` | Enable Windows node DaemonSet | `false` |
173+
| `nodeWindows.maxVolumesPerNode` | Max volumes per node | `59` |
174+
| `nodeWindows.driver.logLevel` | Log level | `DEBUG` |
175+
176+
### StorageClass
177+
178+
| Parameter | Description | Default |
179+
|-----------|-------------|---------|
180+
| `storageClass.enabled` | Create StorageClass | `true` |
181+
| `storageClass.name` | StorageClass name | `vsphere-csi-sc` |
182+
| `storageClass.isDefault` | Set as default StorageClass | `true` |
183+
| `storageClass.allowVolumeExpansion` | Allow volume expansion | `true` |
184+
| `storageClass.reclaimPolicy` | Reclaim policy | `Delete` |
185+
| `storageClass.parameters.datastoreurl` | vSphere datastore URL | `ds:///vmfs/volumes/...` |
186+
187+
### Feature States
188+
189+
All feature flags are configurable under `featureStates`:
190+
191+
| Feature | Default |
192+
|---------|---------|
193+
| `csi-migration` | `true` |
194+
| `csi-auth-check` | `true` |
195+
| `online-volume-extend` | `true` |
196+
| `trigger-csi-fullsync` | `false` |
197+
| `async-query-volume` | `true` |
198+
| `improved-csi-idempotency` | `true` |
199+
| `improved-volume-topology` | `true` |
200+
| `block-volume-snapshot` | `true` |
201+
| `csi-windows-support` | `false` |
202+
| `use-csinode-id` | `true` |
203+
| `list-volumes` | `false` |
204+
| `pv-to-backingdiskobjectid-mapping` | `false` |
205+
| `cnsmgr-suspend-create-volume` | `true` |
206+
| `topology-preferential-datastores` | `true` |
207+
| `max-pvscsi-targets-per-vm` | `true` |
208+
209+
## Verification
210+
211+
After installation, verify the components are running:
212+
213+
```bash
214+
# Check controller
215+
kubectl get deployment vsphere-csi-controller -n vmware-system-csi
216+
217+
# Check node DaemonSet
218+
kubectl get daemonset vsphere-csi-node -n vmware-system-csi
219+
220+
# Check CSIDriver
221+
kubectl get csidriver csi.vsphere.vmware.com
222+
223+
# Check StorageClass
224+
kubectl get storageclass vsphere-csi-sc
225+
226+
# Check pods
227+
kubectl get pods -n vmware-system-csi
228+
```
229+
230+
## License
231+
232+
This chart is provided as-is for deploying the VMware vSphere CSI driver.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Thank you for installing {{ .Chart.Name }} (v{{ .Chart.AppVersion }}).
2+
3+
The vSphere CSI Driver has been deployed to namespace: {{ include "vsphere-csi.namespace" . }}
4+
5+
Components deployed:
6+
- CSIDriver: {{ .Values.csiDriver.name }}
7+
- Controller Deployment ({{ .Values.controller.replicas }} replica(s))
8+
- Node DaemonSet (Linux): {{ if .Values.node.enabled }}enabled{{ else }}disabled{{ end }}
9+
- Node DaemonSet (Windows): {{ if .Values.nodeWindows.enabled }}enabled{{ else }}disabled{{ end }}
10+
11+
IMPORTANT: Make sure you have created the vSphere config secret before deploying:
12+
kubectl create secret generic {{ .Values.controller.vSphereConfigSecret }} \
13+
--from-file=csi-vsphere.conf \
14+
-n {{ include "vsphere-csi.namespace" . }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "vsphere-csi.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create chart name and version as used by the chart label.
10+
*/}}
11+
{{- define "vsphere-csi.chart" -}}
12+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
13+
{{- end }}
14+
15+
{{/*
16+
Common labels
17+
*/}}
18+
{{- define "vsphere-csi.labels" -}}
19+
helm.sh/chart: {{ include "vsphere-csi.chart" . }}
20+
app.kubernetes.io/managed-by: {{ .Release.Service }}
21+
{{- end }}
22+
23+
{{/*
24+
Namespace helper
25+
*/}}
26+
{{- define "vsphere-csi.namespace" -}}
27+
{{- .Values.namespace | default .Release.Namespace }}
28+
{{- end }}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: vsphere-csi-controller-role
5+
labels:
6+
{{- include "vsphere-csi.labels" . | nindent 4 }}
7+
rules:
8+
- apiGroups: [""]
9+
resources: ["nodes", "pods", "configmaps"]
10+
verbs: ["get", "list", "watch"]
11+
- apiGroups: [""]
12+
resources: ["persistentvolumeclaims"]
13+
verbs: ["get", "list", "watch", "update"]
14+
- apiGroups: [""]
15+
resources: ["persistentvolumeclaims/status"]
16+
verbs: ["patch"]
17+
- apiGroups: [""]
18+
resources: ["persistentvolumes"]
19+
verbs: ["get", "list", "watch", "create", "update", "delete", "patch"]
20+
- apiGroups: [""]
21+
resources: ["events"]
22+
verbs: ["get", "list", "watch", "create", "update", "patch"]
23+
- apiGroups: ["coordination.k8s.io"]
24+
resources: ["leases"]
25+
verbs: ["get", "watch", "list", "delete", "update", "create"]
26+
- apiGroups: ["storage.k8s.io"]
27+
resources: ["storageclasses", "csinodes"]
28+
verbs: ["get", "list", "watch"]
29+
- apiGroups: ["storage.k8s.io"]
30+
resources: ["volumeattachments"]
31+
verbs: ["get", "list", "watch", "patch"]
32+
- apiGroups: ["cns.vmware.com"]
33+
resources: ["triggercsifullsyncs"]
34+
verbs: ["create", "get", "update", "watch", "list"]
35+
- apiGroups: ["cns.vmware.com"]
36+
resources: ["cnsvspherevolumemigrations"]
37+
verbs: ["create", "get", "list", "watch", "update", "delete"]
38+
- apiGroups: ["apiextensions.k8s.io"]
39+
resources: ["customresourcedefinitions"]
40+
verbs: ["get", "create", "update"]
41+
- apiGroups: ["storage.k8s.io"]
42+
resources: ["volumeattachments/status"]
43+
verbs: ["patch"]
44+
- apiGroups: ["cns.vmware.com"]
45+
resources: ["cnsvolumeoperationrequests"]
46+
verbs: ["create", "get", "list", "update", "delete"]
47+
- apiGroups: ["snapshot.storage.k8s.io"]
48+
resources: ["volumesnapshots"]
49+
verbs: ["get", "list"]
50+
- apiGroups: ["snapshot.storage.k8s.io"]
51+
resources: ["volumesnapshotclasses"]
52+
verbs: ["watch", "get", "list"]
53+
- apiGroups: ["snapshot.storage.k8s.io"]
54+
resources: ["volumesnapshotcontents"]
55+
verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
56+
- apiGroups: ["snapshot.storage.k8s.io"]
57+
resources: ["volumesnapshotcontents/status"]
58+
verbs: ["update", "patch"]
59+
- apiGroups: ["cns.vmware.com"]
60+
resources: ["csinodetopologies"]
61+
verbs: ["get", "update", "watch", "list"]
62+
---
63+
apiVersion: rbac.authorization.k8s.io/v1
64+
kind: ClusterRole
65+
metadata:
66+
name: vsphere-csi-node-cluster-role
67+
labels:
68+
{{- include "vsphere-csi.labels" . | nindent 4 }}
69+
rules:
70+
- apiGroups: ["cns.vmware.com"]
71+
resources: ["csinodetopologies"]
72+
verbs: ["create", "watch", "get", "patch"]
73+
- apiGroups: [""]
74+
resources: ["nodes"]
75+
verbs: ["get"]

0 commit comments

Comments
 (0)