Browse Source

Exchange data volume for a k8s secret

master
Fábio Kaiser Rauber 3 years ago
parent
commit
0d0b5b4afa
  1. 9
      charts/sapl/v0.2.0/templates/deployment.yaml
  2. 19
      charts/sapl/v0.2.0/templates/pvc-data.yaml
  3. 13
      charts/sapl/v0.2.0/templates/secretkey.yaml

9
charts/sapl/v0.2.0/templates/deployment.yaml

@ -94,12 +94,9 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: data
{{- else }}
emptyDir: {}
{{- end }}
secret:
defaultMode: 440
secretName: {{ include "sapl.fullname" . }}-secretkey
- name: media
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:

19
charts/sapl/v0.2.0/templates/pvc-data.yaml

@ -1,19 +0,0 @@
{{- if .Values.persistence.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
spec:
accessModes:
- {{ .Values.persistence.accessMode }}
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end }}

13
charts/sapl/v0.2.0/templates/secretkey.yaml

@ -0,0 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "sapl.fullname" . }}-secretkey
labels:
{{- include "sapl.labels" . | nindent 4 }}
type: Opaque
data:
{{- if .Release.IsUpgrade }}
secret.key: {{ index (lookup "v1" "Secret" .Release.Namespace (printf "%s-secretkey" (include "sapl.fullname" .))).data "secret.key" }}
{{ else }} # install operation
secret.key: {{ randAscii 50 | b64enc }}
{{ end }}
Loading…
Cancel
Save