Skip to content

Commit

Permalink
ETCD-636: add automated backup side car
Browse files Browse the repository at this point in the history
  • Loading branch information
Elbehery committed Jun 30, 2024
1 parent 0a00f2a commit 3d39bd9
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
32 changes: 32 additions & 0 deletions bindata/etcd/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,34 @@ ${COMPUTED_ENV_VARS}
${COMPUTED_ENV_VARS}
- name: "ETCD_STATIC_POD_VERSION"
value: "REVISION"
# The etcdbackup container copies snapshots from etcd data dir into backup volume.
- name: etcdbackup
image: ${IMAGE}
imagePullPolicy: IfNotPresent
terminationMessagePolicy: FallbackToLogsOnError
command:
- /bin/sh
- -c
- |
#!/bin/sh
set -euo pipefail
sudo cp --verbose --recursive --preserve --reflink=auto /var/lib/etcd/ /var/backup/etcd
resources:
requests:
memory: 60Mi
cpu: 10m
volumeMounts:
- mountPath: /etc/kubernetes/manifests
name: static-pod-dir
- mountPath: /etc/kubernetes/static-pod-resources
name: resource-dir
- mountPath: /etc/kubernetes/static-pod-certs
name: cert-dir
- mountPath: /var/lib/etcd/
name: data-dir
- mountPath: /var/backup/etcd
name: backup-dir
- name: etcd
image: ${IMAGE}
imagePullPolicy: IfNotPresent
Expand Down Expand Up @@ -335,3 +363,7 @@ ${COMPUTED_ENV_VARS}
- hostPath:
path: /var/log/etcd
name: log-dir
- hostPath:
path: /var/backup/etcd
type: ""
name: backup-dir
32 changes: 32 additions & 0 deletions pkg/operator/etcd_assets/bindata.go

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

0 comments on commit 3d39bd9

Please sign in to comment.