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

feat(kubernetes-etcd-backup): s3 support for kubernetes etcd backups #1341

Draft
wants to merge 1 commit into
base: main
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
8 changes: 8 additions & 0 deletions charts/kubernetes-etcd-backup/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions charts/kubernetes-etcd-backup/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
labels:
{{- include "kubernetes-etcd-backup.labels" . | nindent 4 }}
data:
ETCD_BACKUP_S3: {{ .Values.persistence.s3.enabled | quote }}
ETCD_BACKUP_SUBDIR: {{ .Values.backup.subdir | quote }}
ETCD_BACKUP_DIRNAME: {{ .Values.backup.dirname | quote }}
ETCD_BACKUP_EXPIRE_TYPE: {{ .Values.backup.expiretype | quote }}
Expand Down
8 changes: 8 additions & 0 deletions charts/kubernetes-etcd-backup/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ spec:
envFrom:
- configMapRef:
name: {{ include "kubernetes-etcd-backup.fullname" . }}
{{- if .Values.persistence.s3.enabled }}
- secretRef:
{{- if .Values.persistence.s3.existingSecret }}
name: "{{ .Values.persistence.s3.existingSecret }}"
{{- else }}
name: {{ include "kubernetes-etcd-backup.fullname" . }}-secret
{{- end }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 14 }}
volumeMounts:
Expand Down
15 changes: 15 additions & 0 deletions charts/kubernetes-etcd-backup/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if and (.Values.persistence.s3.enabled) (not .Values.persistence.s3.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
labels:
{{- include "kubernetes-etcd-backup.labels" . | nindent 4 }}
name: {{ include "kubernetes-etcd-backup.fullname" . }}-secret
data:
ETCD_BACKUP_S3_NAME: "{{ .Values.persistence.s3.name | b64enc }}"
ETCD_BACKUP_S3_HOST: "{{ .Values.persistence.s3.host | b64enc }}"
ETCD_BACKUP_S3_BUCKET: "{{ .Values.persistence.s3.bucket | b64enc }}"
ETCD_BACKUP_S3_ACCESS_KEY: "{{ .Values.persistence.s3.accessKey | b64enc }}"
ETCD_BACKUP_S3_SECRET_KEY: "{{ .Values.persistence.s3.secretKey | b64enc }}"
type: Opaque
{{- end }}
18 changes: 18 additions & 0 deletions charts/kubernetes-etcd-backup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,24 @@ persistence:
storageClass: ""
# -- Use an exising PVC
existingClaim: ""
s3:
# -- Enable S3 backend storage
enabled: false
# -- S3 endpoint name
name: etcd-backup
# -- S3 endpoint host
host: https://minio.local:9000
# -- Inject OpenShift CA
ca:
enabled: false
# -- S3 bucket name
bucket: etcd-backup
# -- S3 access key
accessKey: mysuperaccesskey
# -- S3 secret key
secretKey: mysupersecretkey
# -- S3 use an existing Secret instead of creating one
existingSecret: ""

image:
# -- Repository image to use
Expand Down
Loading