Skip to content

Commit 85b1294

Browse files
committed
chart: add helm charts for csi drivers
adding helm charts for csi drivers. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
1 parent a2a4a22 commit 85b1294

27 files changed

+1837
-0
lines changed
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/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v2
2+
name: ceph-csi-drivers
3+
description: A Helm chart for Ceph CSI drivers
4+
# A chart can be either an 'application' or a 'library' chart.
5+
#
6+
# Application charts are a collection of templates that can be packaged into versioned archives
7+
# to be deployed.
8+
#
9+
# Library charts provide useful utilities or functions for the chart developer. They're included as
10+
# a dependency of application charts to inject those utilities and functions into the rendering
11+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
12+
type: application
13+
# This is the chart version. This version number should be incremented each time you make changes
14+
# to the chart and its templates, including the app version.
15+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
16+
version: 0.2.0
17+
# This is the version number of the application being deployed. This version number should be
18+
# incremented each time you make changes to the application. Versions are not expected to
19+
# follow Semantic Versioning. They should reflect the version the application is using.
20+
# It is recommended to use it with quotes.
21+
appVersion: "0.2.0"
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "ceph-csi-drivers.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "ceph-csi-drivers.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "ceph-csi-drivers.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "ceph-csi-drivers.labels" -}}
37+
helm.sh/chart: {{ include "ceph-csi-drivers.chart" . }}
38+
{{ include "ceph-csi-drivers.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "ceph-csi-drivers.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "ceph-csi-drivers.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "ceph-csi-drivers.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "ceph-csi-drivers.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+
64+
{{/* Helper function to normalize the driver name */}}
65+
{{- define "normalizeDriverName" -}}
66+
{{- . | lower | replace "." "-" -}}
67+
{{- end -}}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- $root := . -}}
2+
{{- range $cephConnection := .Values.cephConnections -}}
3+
{{- if $cephConnection.name -}}
4+
apiVersion: csi.ceph.io/v1alpha1
5+
kind: CephConnection
6+
metadata:
7+
name: {{ $cephConnection.name }}
8+
namespace: {{ $root.Release.Namespace }}
9+
spec:
10+
monitors:
11+
{{- range $cephConnection.monitors }}
12+
- {{ . }}
13+
{{- end }}
14+
rbdMirrorDaemonCount: {{ $cephConnection.rbdMirrorDaemonCount }}
15+
readAffinity:
16+
crushLocationLabels:
17+
{{- range $cephConnection.crushLocationLabels }}
18+
- {{ . }}
19+
{{- end }}
20+
{{- end }}
21+
{{- end }}
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
{{- $root := . -}}
2+
{{- range $driver := .Values.drivers -}}
3+
{{- if hasSuffix "cephfs.csi.ceph.com" $driver.name }}
4+
{{- $normalizedDriverName := include "normalizeDriverName" $driver.name }}
5+
apiVersion: rbac.authorization.k8s.io/v1
6+
kind: ClusterRole
7+
metadata:
8+
name: {{ $normalizedDriverName }}-ctrlplugin-cr
9+
rules:
10+
- apiGroups:
11+
- ""
12+
resources:
13+
- secrets
14+
verbs:
15+
- get
16+
- list
17+
- apiGroups:
18+
- ""
19+
resources:
20+
- configmaps
21+
verbs:
22+
- get
23+
- apiGroups:
24+
- ""
25+
resources:
26+
- nodes
27+
verbs:
28+
- get
29+
- list
30+
- watch
31+
- apiGroups:
32+
- storage.k8s.io
33+
resources:
34+
- csinodes
35+
verbs:
36+
- get
37+
- list
38+
- watch
39+
- apiGroups:
40+
- ""
41+
resources:
42+
- persistentvolumes
43+
verbs:
44+
- get
45+
- list
46+
- watch
47+
- create
48+
- delete
49+
- patch
50+
- update
51+
- apiGroups:
52+
- ""
53+
resources:
54+
- persistentvolumeclaims
55+
verbs:
56+
- get
57+
- list
58+
- watch
59+
- patch
60+
- update
61+
- apiGroups:
62+
- storage.k8s.io
63+
resources:
64+
- storageclasses
65+
verbs:
66+
- get
67+
- list
68+
- watch
69+
- apiGroups:
70+
- ""
71+
resources:
72+
- events
73+
verbs:
74+
- list
75+
- watch
76+
- create
77+
- update
78+
- patch
79+
- apiGroups:
80+
- storage.k8s.io
81+
resources:
82+
- volumeattachments
83+
verbs:
84+
- get
85+
- list
86+
- watch
87+
- patch
88+
- apiGroups:
89+
- storage.k8s.io
90+
resources:
91+
- volumeattachments/status
92+
verbs:
93+
- patch
94+
- apiGroups:
95+
- ""
96+
resources:
97+
- persistentvolumeclaims/status
98+
verbs:
99+
- patch
100+
- apiGroups:
101+
- snapshot.storage.k8s.io
102+
resources:
103+
- volumesnapshots
104+
verbs:
105+
- get
106+
- list
107+
- apiGroups:
108+
- snapshot.storage.k8s.io
109+
resources:
110+
- volumesnapshotclasses
111+
verbs:
112+
- get
113+
- list
114+
- watch
115+
- apiGroups:
116+
- snapshot.storage.k8s.io
117+
resources:
118+
- volumesnapshotcontents
119+
verbs:
120+
- get
121+
- list
122+
- watch
123+
- patch
124+
- update
125+
- apiGroups:
126+
- snapshot.storage.k8s.io
127+
resources:
128+
- volumesnapshotcontents/status
129+
verbs:
130+
- update
131+
- patch
132+
- apiGroups:
133+
- groupsnapshot.storage.k8s.io
134+
resources:
135+
- volumegroupsnapshotclasses
136+
verbs:
137+
- get
138+
- list
139+
- watch
140+
- apiGroups:
141+
- groupsnapshot.storage.k8s.io
142+
resources:
143+
- volumegroupsnapshotcontents
144+
verbs:
145+
- get
146+
- list
147+
- watch
148+
- update
149+
- patch
150+
- apiGroups:
151+
- groupsnapshot.storage.k8s.io
152+
resources:
153+
- volumegroupsnapshotcontents/status
154+
verbs:
155+
- update
156+
- patch
157+
- apiGroups:
158+
- ""
159+
resources:
160+
- serviceaccounts
161+
verbs:
162+
- get
163+
- apiGroups:
164+
- ""
165+
resources:
166+
- serviceaccounts/token
167+
verbs:
168+
- create
169+
{{- end }}
170+
{{- end }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- $root := . -}}
2+
{{- range $driver := .Values.drivers -}}
3+
{{- if hasSuffix "cephfs.csi.ceph.com" $driver.name }}
4+
{{- $normalizedDriverName := include "normalizeDriverName" $driver.name }}
5+
apiVersion: rbac.authorization.k8s.io/v1
6+
kind: ClusterRoleBinding
7+
metadata:
8+
name: {{ $normalizedDriverName }}-ctrlplugin-crb
9+
roleRef:
10+
apiGroup: rbac.authorization.k8s.io
11+
kind: ClusterRole
12+
name: {{ $normalizedDriverName }}-ctrlplugin-cr
13+
subjects:
14+
- kind: ServiceAccount
15+
name: {{ $normalizedDriverName }}-ctrlplugin-sa
16+
namespace: {{ $root.Release.Namespace }}
17+
{{- end }}
18+
{{- end }}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{{- $root := . -}}
2+
{{- range $driver := .Values.drivers -}}
3+
{{- if hasSuffix "cephfs.csi.ceph.com" $driver.name }}
4+
{{- $normalizedDriverName := include "normalizeDriverName" $driver.name }}
5+
apiVersion: rbac.authorization.k8s.io/v1
6+
kind: Role
7+
metadata:
8+
name: {{ $normalizedDriverName }}-ctrlplugin-r
9+
rules:
10+
- apiGroups:
11+
- coordination.k8s.io
12+
resources:
13+
- leases
14+
verbs:
15+
- get
16+
- watch
17+
- list
18+
- delete
19+
- update
20+
- create
21+
- apiGroups:
22+
- csiaddons.openshift.io
23+
resources:
24+
- csiaddonsnodes
25+
verbs:
26+
- get
27+
- watch
28+
- list
29+
- create
30+
- update
31+
- delete
32+
- apiGroups:
33+
- ""
34+
resources:
35+
- pods
36+
verbs:
37+
- get
38+
- apiGroups:
39+
- apps
40+
resources:
41+
- replicasets
42+
verbs:
43+
- get
44+
- apiGroups:
45+
- apps
46+
resources:
47+
- deployments/finalizers
48+
- daemonsets/finalizers
49+
verbs:
50+
- update
51+
- apiGroups:
52+
- authentication.k8s.io
53+
resources:
54+
- tokenreviews
55+
verbs:
56+
- create
57+
{{- end }}
58+
{{- end }}

0 commit comments

Comments
 (0)