Backup / DR

https://argoproj.github.io/argo-cd/operator-manual/disaster_recovery/

EKS์šฉ argocd ๋„์ปค ์ž‘์„ฑ

๋งค๋‰ด์–ผ๋Œ€๋กœ ํ•˜๋ฉด aws์ธ์ฆ๋•Œ๋ฌธ์— ์‹คํŒจํ•œ๋‹ค. ๋„์ปค๋ฅผ ๊ฐ€์ง€๊ณ  ์™€์„œ ์ถ”๊ฐ€ ํ”„๋กœ๊ทธ๋žจ์„ ์„ค์น˜ ํ•ด์ค˜์•ผํ•œ๋‹ค.

์ผ๋‹จ ๋„์ปค๋ฅผ ๋งŒ๋“ค์–ด๋ณด์ž.

๊ฐ€๊ธ‰์ ์ด๋ฉด ๋ณธ์ธ์ด ์‚ฌ์šฉํ•˜๋Š” ๋ฒ„์ „๊ณผ ๊ฐ™์€ ๋ฒ„์ „์„ ์‚ฌ์šฉํ•œ๋‹ค.

Dockerfile
FROM argoproj/argocd:v2.0.3

USER root

RUN apt-get update
RUN apt install sudo -y
RUN apt install curl -y
RUN apt install unzip -y

RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
RUN unzip awscliv2.zip
RUN ./aws/install

RUN curl -o aws-iam-authenticator https://amazon-eks.s3.us-west-2.amazonaws.com/1.19.6/2021-01-05/bin/linux/amd64/aws-iam-authenticator
RUN chmod +x aws-iam-authenticator
RUN mv aws-iam-authenticator /usr/local/sbin/

USER argocd

ENV AWS_PROFILE=xxxx #์‚ฌ์šฉํ•˜๋Š” ํ”„๋กœํŒŒ์ผ๋ช…

์ด์ œ ๋„์ปค๋ฅผ ๋นŒ๋“œํ•ด๋ณด์ž.

cd eks-argocd
docker build -t eks-argocd .

์ด์ œ ์—ฌ๊ธฐ์— kube ์„ค์ •๊ณผ aws์„ค์ •์„ ๋งˆ์šดํŠธํ•ด์ฃผ๊ณ  export ์ปค๋งจ๋“ค๋ฅด ์‹คํ–‰ํ•˜๋ฉด๋œ๋‹ค.

backup

docker run -v ~/.kube:/home/argocd/.kube \
-v ~/.aws:/home/argocd/.aws \
--rm \
eks-argocd argocd-util export \
--kubeconfig /home/argocd/.kube/aws-xxxx \
--namespace argocd > backup.yaml

restore

docker run -v ~/.kube:/home/argocd/.kube \
-v ~/.aws:/home/argocd/.aws \
--rm \
eks-argocd argocd-util import \
--kubeconfig /home/argocd/.kube/aws-xxxx \
--namespace argocd - < backup.yaml

Last updated

Was this helpful?