-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from adfinis/feat/k8s-etcd-backup-updates
feat(etcd-backup): simplify Dockerfile and fix CJ/backup script
- Loading branch information
Showing
4 changed files
with
8 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
FROM registry.access.redhat.com/ubi8-minimal:8.8-1072.1696517598 | ||
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9-1029 | ||
|
||
LABEL org.opencontainers.image.authors="Adfinis AG <https://adfinis.com>" | ||
LABEL org.opencontainers.image.vendor="Adfinis" | ||
|
||
COPY backup.sh /usr/local/bin/backup.sh | ||
|
||
RUN microdnf update -y && rm -rf /var/cache/yum | ||
RUN microdnf install findutils wget tar gzip -y && microdnf clean all | ||
RUN wget https://github.com/etcd-io/etcd/releases/download/v3.4.27/etcd-v3.4.27-linux-amd64.tar.gz -O /tmp/etcd-v3.4.27-linux-amd64.tar.gz | ||
RUN tar -xvf /tmp/etcd-v3.4.27-linux-amd64.tar.gz -C /tmp/ && mv /tmp/etcd-v3.4.27-linux-amd64/etcdctl /usr/local/bin/etcdctl && rm -rf /tmp/etcd-v3.4.27-linux-amd64* | ||
|
||
RUN microdnf install findutils curl tar gzip -y && microdnf clean all | ||
RUN curl -L https://github.com/etcd-io/etcd/releases/download/v3.5.11/etcd-v3.5.11-linux-amd64.tar.gz | tar xfz - -C /tmp --strip-components=1 --no-same-owner -- etcd-v3.5.11-linux-amd64/etcdctl | ||
|
||
CMD ["/usr/local/bin/backup.sh"] |
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
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 |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
# Authors: | ||
# Cyrill von Wattenwyl <[email protected]> | ||
# Felix Niederer <[email protected]> | ||
# Valentin Maillot <[email protected]> | ||
|
||
|
||
set -xeuo pipefail | ||
|
@@ -64,7 +65,7 @@ mkdir -p "/tmp/etcd-backup" | |
mkdir -p "${BACKUP_PATH_POD}" | ||
|
||
# create backup to temporary location | ||
ETCDCTL_API=3 etcdctl --endpoints ${ENDPOINT}:2379 --cacert='/etc/kubernetes/pki/etcd-ca/service-ca.crt' --cert='/etc/kubernetes/pki/etcd-peer/tls.crt' --key='/etc/kubernetes/pki/etcd-peer/tls.key' snapshot save /tmp/etcd-backup/snapshot.db | ||
ETCDCTL_API=3 etcdctl --endpoints ${ENDPOINT}:2379 --cacert='/etc/kubernetes/pki/etcd-ca/ca.crt' --cert='/etc/kubernetes/pki/etcd-peer/tls.crt' --key='/etc/kubernetes/pki/etcd-peer/tls.key' snapshot save /tmp/etcd-backup/snapshot.db | ||
ETCDCTL_API=3 etcdctl --write-out=table snapshot status /tmp/etcd-backup/snapshot.db | ||
|
||
# move files to pvc and delete temporary files | ||
|