Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Helm chart #382

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deploy/kubernetes/helm/csi-digitalocean/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
5 changes: 5 additions & 0 deletions deploy/kubernetes/helm/csi-digitalocean/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: csi-digitalocean
version: 2.1.1
appVersion: 2.1.1
type: application
515 changes: 515 additions & 0 deletions deploy/kubernetes/helm/csi-digitalocean/crds/crds.yaml

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions deploy/kubernetes/helm/csi-digitalocean/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "csi-digitalocean.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 45 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 45 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 "csi-digitalocean.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 45 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 45 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 45 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "csi-digitalocean.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 45 | trimSuffix "-" -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ printf "%s-attacher-role" (include "csi-digitalocean.fullname" .) | quote }}
namespace: {{ .Release.Namespace | quote }}
labels:
helm.sh/chart: {{ include "csi-digitalocean.chart" . | quote }}
app.kubernetes.io/name: {{ include "csi-digitalocean.name" . | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/component: attacher
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments/status"]
verbs: ["patch"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ printf "%s-attacher-binding" (include "csi-digitalocean.fullname" .) | quote }}
namespace: {{ .Release.Namespace | quote }}
labels:
helm.sh/chart: {{ include "csi-digitalocean.chart" . | quote }}
app.kubernetes.io/name: {{ include "csi-digitalocean.name" . | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/component: attacher
subjects:
- kind: ServiceAccount
name: {{ printf "%s-controller-sa" (include "csi-digitalocean.fullname" .) | quote }}
namespace: {{ .Release.Namespace | quote }}
roleRef:
kind: ClusterRole
name: {{ printf "%s-attacher-role" (include "csi-digitalocean.fullname" .) | quote }}
apiGroup: rbac.authorization.k8s.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: {{ .Values.storageClass.name | quote }}
namespace: {{ .Release.Namespace | quote }}
labels:
helm.sh/chart: {{ include "csi-digitalocean.chart" . | quote }}
app.kubernetes.io/name: {{ include "csi-digitalocean.name" . | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/compnent: driver
annotations:
storageclass.kubernetes.io/is-default-class: {{ .Values.storageClass.default | quote }}
provisioner: {{ .Values.driver.name | quote }}
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy | quote }}
allowVolumeExpansion: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
kind: VolumeSnapshotClass
apiVersion: snapshot.storage.k8s.io/v1beta1
metadata:
name: {{ .Values.storageClass.name | quote }}
namespace: {{ .Release.Namespace | quote }}
labels:
helm.sh/chart: {{ include "csi-digitalocean.chart" . | quote }}
app.kubernetes.io/name: {{ include "csi-digitalocean.name" . | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/component: driver
annotations:
snapshot.storage.kubernetes.io/is-default-class: "true"
driver: {{ .Values.driver.name | quote }}
deletionPolicy: {{ .Values.storageClass.snapshot.deletionPolicy | quote }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kind: ServiceAccount
apiVersion: v1
metadata:
name: {{ printf "%s-controller-sa" (include "csi-digitalocean.fullname" .) | quote }}
namespace: {{ .Release.Namespace | quote }}
labels:
helm.sh/chart: {{ include "csi-digitalocean.chart" . | quote }}
app.kubernetes.io/name: {{ include "csi-digitalocean.name" . | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/component: controller
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: {{ printf "%s-controller" (include "csi-digitalocean.fullname" .) | quote }}
namespace: {{ .Release.Namespace | quote }}
labels:
helm.sh/chart: {{ include "csi-digitalocean.chart" . | quote }}
app.kubernetes.io/name: {{ include "csi-digitalocean.name" . | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/component: controller
spec:
serviceName: {{ printf "%s-controller" (include "csi-digitalocean.fullname" .) | quote }}
replicas: {{ .Values.controller.replicas | int }}
selector:
matchLabels:
app.kubernetes.io/name: {{ printf "%s-controller" (include "csi-digitalocean.fullname" .) | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/component: controller
template:
metadata:
labels:
app.kubernetes.io/name: {{ printf "%s-controller" (include "csi-digitalocean.fullname" .) | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/component: controller
annotations:
checksum/secret: {{ pick (include (print $.Template.BasePath "/secret.yaml") . | fromYaml) "data" | toYaml | sha256sum | quote }}
spec:
priorityClassName: system-cluster-critical
serviceAccountName: {{ printf "%s-controller-sa" (include "csi-digitalocean.fullname" .) | quote }}
{{- with .Values.controller.affinity }}
affinity: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: csi-provisioner
image: {{ printf "%s:%s" .Values.controller.provisioner.image.repository .Values.controller.provisioner.image.tag | quote }}
imagePullPolicy: {{ .Values.controller.provisioner.image.pullPolicy | quote }}
args:
- "--csi-address=$(ADDRESS)"
- "--default-fstype=ext4"
- "--v=5"
{{- with .Values.controller.provisioner.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-attacher
image: {{ printf "%s:%s" .Values.controller.attacher.image.repository .Values.controller.attacher.image.tag | quote }}
imagePullPolicy: {{ .Values.controller.attacher.image.pullPolicy | quote }}
args:
- "--csi-address=$(ADDRESS)"
- "--v=5"
{{- with .Values.controller.attacher.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-snapshotter
image: {{ printf "%s:%s" .Values.controller.snapshotter.image.repository .Values.controller.snapshotter.image.tag | quote }}
imagePullPolicy: {{ .Values.controller.snapshotter.image.pullPolicy | quote }}
args:
- "--csi-address=$(ADDRESS)"
- "--v=5"
{{- with .Values.controller.snapshotter.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-resizer
image: {{ printf "%s:%s" .Values.controller.resizer.image.repository .Values.controller.resizer.image.tag | quote }}
imagePullPolicy: {{ .Values.controller.resizer.image.pullPolicy | quote }}
args:
- "--csi-address=$(ADDRESS)"
- "--timeout=30s"
- "--v=5"
# DigitalOcean volumes support online resize.
- "--handle-volume-inuse-error=false"
{{- with .Values.controller.resizer.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-do-plugin
image: {{ printf "%s:%s" .Values.plugin.image.repository .Values.plugin.image.tag | quote }}
imagePullPolicy: {{ .Values.plugin.image.pullPolicy | quote }}
args:
- "--endpoint=$(CSI_ENDPOINT)"
- "--token=$(DIGITALOCEAN_ACCESS_TOKEN)"
- "--url=$(DIGITALOCEAN_API_URL)"
{{- with .Values.plugin.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: CSI_ENDPOINT
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
- name: DIGITALOCEAN_API_URL
value: https://api.digitalocean.com/
- name: DIGITALOCEAN_ACCESS_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "csi-digitalocean.fullname" . | quote }}
key: access-token
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
volumes:
- name: socket-dir
emptyDir: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: CSIDriver
apiVersion: storage.k8s.io/v1beta1
metadata:
name: {{ .Values.driver.name | quote }}
namespace: {{ .Release.Namespace | quote }}
labels:
helm.sh/chart: {{ include "csi-digitalocean.chart" . | quote }}
app.kubernetes.io/name: {{ include "csi-digitalocean.name" . | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/component: driver
spec:
attachRequired: true
podInfoOnMount: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ printf "%s-node-driver-registrar-role" (include "csi-digitalocean.fullname" .) | quote }}
namespace: {{ .Release.Namespace | quote }}
labels:
helm.sh/chart: {{ include "csi-digitalocean.chart" . | quote }}
app.kubernetes.io/name: {{ include "csi-digitalocean.name" . | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/component: node-driver
rules:
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ printf "%s-node-driver-registrar-binding" (include "csi-digitalocean.fullname" .) | quote }}
namespace: {{ .Release.Namespace | quote }}
labels:
helm.sh/chart: {{ include "csi-digitalocean.chart" . | quote }}
app.kubernetes.io/name: {{ include "csi-digitalocean.name" . | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/component: node-driver
subjects:
- kind: ServiceAccount
name: {{ printf "%s-node-sa" (include "csi-digitalocean.fullname" .) | quote }}
namespace: {{ .Release.Namespace | quote }}
roleRef:
kind: ClusterRole
name: {{ printf "%s-node-driver-registrar-role" (include "csi-digitalocean.fullname" .) | quote }}
apiGroup: rbac.authorization.k8s.io
Loading