-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helm: support encryption config in ceph-csi-cephfs chart
this chart currently lack the ability to properly configure encryption, as well as granting sufficent permission to allow controllers to access secret when needed. Signed-off-by: Antoine C <[email protected]>
- Loading branch information
1 parent
29f1fbe
commit f267ec4
Showing
7 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
charts/ceph-csi-cephfs/templates/encryptionkms-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .Values.kmsConfigMapName | quote }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app: {{ include "ceph-csi-cephfs.name" . }} | ||
chart: {{ include "ceph-csi-cephfs.chart" . }} | ||
component: {{ .Values.nodeplugin.name }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} | ||
data: | ||
config.json: |- | ||
{{ toJson .Values.encryptionKMSConfig | indent 4 -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{- if .Values.rbac.create -}} | ||
{{- if and .Values.encryptionKMSConfig .Values.encryptionKMSConfig.secretNamespace .Values.encryptionKMSConfig.secretName (eq .Values.encryptionKMSConfig.secretNamespace .Release.Namespace) -}} | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "ceph-csi-cephfs.nodeplugin.fullname" . }} | ||
labels: | ||
app: {{ include "ceph-csi-cephfs.name" . }} | ||
chart: {{ include "ceph-csi-cephfs.chart" . }} | ||
component: {{ .Values.nodeplugin.name }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} | ||
rules: | ||
# allow to read the encryption key used with the metadata KMS | ||
- apiGroups: [""] | ||
resources: ["secrets"] | ||
verbs: ["get"] | ||
resourceNames: [{{ .Values.encryptionKMSConfig.secretName | quote }}] | ||
{{- end -}} | ||
{{- end -}} |
24 changes: 24 additions & 0 deletions
24
charts/ceph-csi-cephfs/templates/nodeplugin-rolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{{- if .Values.rbac.create -}} | ||
{{- if and (eq .Values.encryptionKMSConfig.encryptionKMSType "metadata") (eq .Values.encryptionKMSConfig.secretNamespace .Release.Namespace) -}} | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "ceph-csi-cephfs.nodeplugin.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app: {{ include "ceph-csi-cephfs.name" . }} | ||
chart: {{ include "ceph-csi-cephfs.chart" . }} | ||
component: {{ .Values.nodeplugin.name }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "ceph-csi-cephfs.serviceAccountName.nodeplugin" . }} | ||
namespace: {{ .Release.Namespace }} | ||
roleRef: | ||
kind: Role | ||
name: {{ include "ceph-csi-cephfs.nodeplugin.fullname" . }} | ||
apiGroup: rbac.authorization.k8s.io | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters