Skip to content

Commit

Permalink
feat(): allow using custom CA
Browse files Browse the repository at this point in the history
  • Loading branch information
norbertgruszka committed Dec 23, 2024
1 parent 5215c69 commit 1811026
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
14 changes: 12 additions & 2 deletions charts/kubernetes-etcd-backup/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ spec:
template:
spec:
securityContext:
runAsUser: 1000
fsGroup: 1000
{{- toYaml .Values.podSecurityContext | nindent 12 }}
containers:
- command:
- /bin/sh
- /usr/local/bin/backup.sh
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 14 }}
envFrom:
- configMapRef:
name: {{ include "kubernetes-etcd-backup.fullname" . }}
Expand All @@ -43,6 +44,10 @@ spec:
mountPath: /etc/kubernetes/pki/etcd-ca
- name: volume-backup
mountPath: /backup
{{- if and (.Values.persistence.s3.enabled) (.Values.persistence.s3.ca.enabled) }}
- name: s3-ca
mountPath: /etc/pki/ca-trust/source/anchors
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
{{- end }}
Expand All @@ -54,6 +59,11 @@ spec:
- name: etcd-server-ca
secret:
secretName: {{ .Values.etcdCertification.etcdServerCaName }}
{{- if and (.Values.persistence.s3.enabled) (.Values.persistence.s3.ca.enabled) }}
- name: s3-ca
secret:
secretName: {{ .Values.persistence.s3.ca.secretName }}
{{- end }}
- name: volume-backup
{{- if .Values.persistence.nfs.enabled }}
nfs:
Expand Down
16 changes: 16 additions & 0 deletions charts/kubernetes-etcd-backup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ persistence:
secretKey: mysupersecretkey
# -- S3 use an existing Secret instead of creating one
existingSecret: ""
ca:
enabled: false
secretName: "changeme"

image:
# -- Repository image to use
Expand Down Expand Up @@ -131,3 +134,16 @@ extraVolumes: []
## Additional volumes to the pod.
# - name: additional-volume
# emptyDir: {}

securityContext: {}
podSecurityContext:
runAsUser: 1000
fsGroup: 1000
# Settings required when s3 persistence is used
# Required because of `update-ca-trust` command
# # -- Run pod as privileged
# privileged: true
# # -- Set user ID
# runAsUser: 0
# # -- Set group ID
# runAsGroup: 0

0 comments on commit 1811026

Please sign in to comment.