Skip to content

Commit

Permalink
Add vsphere-csi-driver chart
Browse files Browse the repository at this point in the history
  • Loading branch information
a13x5 committed Sep 7, 2024
1 parent 4206d00 commit e78c1b6
Show file tree
Hide file tree
Showing 16 changed files with 850 additions and 0 deletions.
23 changes: 23 additions & 0 deletions mirantis/vsphere-csi-driver/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions mirantis/vsphere-csi-driver/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: vsphere-csi-driver
description: A Helm chart for Container Storage Interface (CSI) driver for vSphere

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "3.3.1"
53 changes: 53 additions & 0 deletions mirantis/vsphere-csi-driver/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# vSphere CSI Driver

A Helm chart for Container Storage Interface (CSI) driver for vSphere

This chart is based on the official [vsphere csi driver vanilla manifest](https://github.com/kubernetes-sigs/vsphere-csi-driver/blob/master/manifests/vanilla/vsphere-csi-driver.yaml).

The default storage class can be created via `defaultStorageClass.enabled`
option.

You can also create the
[configuration](https://docs.vmware.com/en/VMware-vSphere-Container-Storage-Plug-in/2.0/vmware-vsphere-csp-getting-started/GUID-BFF39F1D-F70A-4360-ABC9-85BDAFBE8864.html)
secret by setting `vcenterConfig.enabled` to true and passing all the rest
values under `vcenterConfig`.


## Values

| Key | Type | Default | Description |
|------------------------------------------|--------|-----------------------------------------------------------|------------------------------------------------------------------------------------|
| controller.nodeAffinity | map | | Controller's node affinity |
| controller.replicas | int | `1` | Number of replicas for controller's deployment |
| controller.tolerations | map | | Controller's tolerations |
| defaultStorageClass.allowVolumeExpansion | bool | `true` | Allow volume expansion for a default storage class |
| defaultStorageClass.enabled | bool | `false` | Create default storage class |
| defaultStorageClass.name | string | `"vsphere-csi"` | Name of the default storage class |
| images.csiAttacher.repo | string | `"registry.k8s.io/sig-storage/csi-attacher"` | Repo for the CSI attacher |
| images.csiAttacher.tag | string | `"v4.5.1"` | Tag for the CSI attacher |
| images.csiProvisioner.repo | string | `"registry.k8s.io/sig-storage/csi-provisioner"` | Repo for the CSI provisioner |
| images.csiProvisioner.tag | string | `"v4.0.1"` | Tag for the CSI provisioner |
| images.csiResizer.repo | string | `"registry.k8s.io/sig-storage/csi-resizer"` | Repo for the CSI resizer |
| images.csiResizer.tag | string | `"v1.10.1"` | Tag for the CSI resizer |
| images.csiSnapshotter.repo | string | `"registry.k8s.io/sig-storage/csi-snapshotter"` | Repo for the CSI snapshotter |
| images.csiSnapshotter.tag | string | `"v7.0.2"` | Tag for the CSI snapshotter |
| images.driver.repo | string | `"gcr.io/cloud-provider-vsphere/csi/release/driver"` | Repo for the vcenter CSI provider driver |
| images.driver.tag | string | `"v3.3.1"` | Tag for the vcenter CSI provider driver |
| images.livenessProbe.repo | string | `"registry.k8s.io/sig-storage/livenessprobe"` | Repo for the livenessprobe |
| images.livenessProbe.tag | string | `"v2.12.0"` | Tag for the livenessprobe |
| images.nodeDriverRegistrar.repo | string | `"registry.k8s.io/sig-storage/csi-node-driver-registrar"` | Repo for the CSI driver registrar |
| images.nodeDriverRegistrar.tag | string | `"v2.10.1"` | Tag for the CSI driver registrar |
| images.syncer.repo | string | `"gcr.io/cloud-provider-vsphere/csi/release/syncer"` | Repo for the vcenter CSI provider syncer |
| images.syncer.tag | string | `"v3.3.1"` | Tag for the vcenter CSI provider syncer |
| node.kubeletPath | string | `"/var/lib/kubelet"` | Kubelet path on the node |
| node.tolerations | map | | Node provisioner tolerations |
| vcenterConfig.clusterID | string | `""` | The unique cluster identifier |
| vcenterConfig.datacenters | string | `""` | List of all comma separated datacenter paths where Kubernetes node VMs are present |
| vcenterConfig.enabled | bool | `false` | Create vcenter config secret |
| vcenterConfig.insecure | string | `"true"` | Set to true if you use self-signed certificate |
| vcenterConfig.password | string | `""` | Password for a vCenter Server user |
| vcenterConfig.port | string | `"443"` | vCenter Server port. |
| vcenterConfig.secretName | string | `"vcenter-config-secret"` | Name of the vcenter config secret |
| vcenterConfig.thumbprint | string | `""` | The certificate thumbprint (optional) |
| vcenterConfig.user | string | `""` | The vCenter Server username |
| vcenterConfig.vcenter | string | `""` | IP or FQDN of the vcenter instance |
74 changes: 74 additions & 0 deletions mirantis/vsphere-csi-driver/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "vsphere-csi-driver.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{- define "vsphere-csi-driver.controller.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}-controller
{{- end }}

{{- define "vsphere-csi-driver.node.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}-node
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "vsphere-csi-driver.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{- define "vsphere-csi-driver.controller.fullname" -}}
{{ include "vsphere-csi-driver.fullname" . }}-controller
{{- end }}

{{- define "vsphere-csi-driver.node.fullname" -}}
{{ include "vsphere-csi-driver.fullname" . }}-node
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "vsphere-csi-driver.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "vsphere-csi-driver.labels" -}}
helm.sh/chart: {{ include "vsphere-csi-driver.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}


{{- define "vsphere-csi-driver.controller.selectorLabels" -}}
app.kubernetes.io/name: {{ include "vsphere-csi-driver.controller.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "vsphere-csi-driver.node.selectorLabels" -}}
app.kubernetes.io/name: {{ include "vsphere-csi-driver.node.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "vsphere-csi-driver.controller.serviceAccountName" -}}
{{ include "vsphere-csi-driver.controller.fullname" . }}
{{- end }}

{{- define "vsphere-csi-driver.node.serviceAccountName" -}}
{{ include "vsphere-csi-driver.node.fullname" . }}
{{- end }}
22 changes: 22 additions & 0 deletions mirantis/vsphere-csi-driver/templates/config-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if .Values.vcenterConfig.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.vcenterConfig.secretName }}
labels:
{{- include "vsphere-csi-driver.labels" . | nindent 4 }}
stringData:
csi-vsphere.conf: |
[Global]
cluster-id = "{{ .Values.vcenterConfig.clusterID }}"
{{- if .Values.vcenterConfig.thumbprint }}
thumbprint = "{{ .Values.vcenterConfig.thumbprint }}"
{{- end }}
[VirtualCenter "{{ .Values.vcenterConfig.vcenter }}"]
insecure-flag = "{{ .Values.vcenterConfig.insecure }}"
user = "{{ .Values.vcenterConfig.user }}"
password = "{{ .Values.vcenterConfig.password }}"
port = "{{ .Values.vcenterConfig.port }}"
datacenters = "{{ .Values.vcenterConfig.datacenters }}"
{{- end }}
Loading

0 comments on commit e78c1b6

Please sign in to comment.