From 2e37c8fdf0c18c8e39394dc349403e8a9805ea65 Mon Sep 17 00:00:00 2001 From: WoozyMasta Date: Sun, 7 Feb 2021 10:34:43 +0300 Subject: [PATCH] added git with ssh key cronjob --- deploy/cronjob-git-key.yaml | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 deploy/cronjob-git-key.yaml diff --git a/deploy/cronjob-git-key.yaml b/deploy/cronjob-git-key.yaml new file mode 100644 index 0000000..7b92d8d --- /dev/null +++ b/deploy/cronjob-git-key.yaml @@ -0,0 +1,61 @@ +--- +apiVersion: batch/v1beta1 +kind: CronJob +metadata: + labels: + app: kube-dump + name: kube-dump + namespace: kube-dump +spec: + schedule: "0 1 * * *" + jobTemplate: + spec: + template: + spec: + serviceAccountName: kube-dump + containers: + - name: kube-dump + image: woozymasta/kube-dump:1.0 + imagePullPolicy: IfNotPresent + envFrom: + - secretRef: + name: kube-dump + env: + - name: MODE + value: "dump" + - name: GIT_PUSH + value: "true" + - name: GIT_BRANCH + value: "k8s-cluster" + - name: GIT_REMOTE_URL + value: "git@corp-gitlab.com:devops/cluster-bkp.git" + volumeMounts: + - name: key + mountPath: /root/.ssh/id_ed25519 + subPath: id_ed25519 + readOnly: true + - name: key-pub + mountPath: /root/.ssh/id_ed25519.pub + subPath: id_ed25519.pub + readOnly: true + resources: + limits: + cpu: 500m + memory: 200Mi + requests: + cpu: 200m + memory: 100Mi + restartPolicy: OnFailure + volumes: + - name: key + secret: + secretName: kube-dump-key + items: + - key: kube-dump + path: id_ed25519 + - name: key-pub + secret: + secretName: kube-dump-key + items: + - key: kube-dump.pub + path: id_ed25519.pub