123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: gogs
- spec:
- replicas: 1
- selector:
- matchLabels:
- name: gogs
- template:
- metadata:
- labels:
- name: gogs
- nginx: backend
- spec:
- containers:
- - name: gogs
- image: gogs/gogs
- imagePullPolicy: "Always"
- env:
- - name: RUN_CROND
- value: "true"
- - name: SOCAT_LINK
- value: "false"
- - name: BACKUP_INTERVAL
- value: "7d"
- - name: BACKUP_RETENTION
- value: "30d"
- - name: PUID
- value: "1000"
- - name: GUID
- value: "1000"
- volumeMounts:
- - name: gogs
- mountPath: /data
- - name: backup
- mountPath: /backup
- ports:
- - containerPort: 22
- name: ssh
- - containerPort: 3000
- name: http
- livenessProbe:
- initialDelaySeconds: 300
- timeoutSeconds: 10
- httpGet:
- port: 3000
- httpHeaders:
- - name: Host
- value: "gogs.dodges.it"
- volumes:
- - name: gogs
- persistentVolumeClaim:
- claimName: gogs
- - name: backup
- hostPath:
- type: DirectoryOrCreate
- path: /tmp/backup
- ---
- apiVersion: batch/v1
- kind: CronJob
- metadata:
- name: gogs-backup
- spec:
- schedule: "@weekly"
- jobTemplate:
- spec:
- template:
- spec:
- affinity:
- nodeAffinity:
- requiredDuringSchedulingIgnoredDuringExecution:
- nodeSelectorTerms:
- - matchExpressions:
- - key: kubernetes.io/arch
- operator: In
- values:
- - amd64
- containers:
- - name: gogs-backup
- image: qdii/backup-rsync:latest
- env:
- - name: LOCAL_FOLDER_PATH
- value: /mnt
- - name: REMOTE_USER
- value: "uab10c1ba4bc"
- - name: REMOTE_SERVER
- value: "bck.dodges.it"
- - name: REMOTE_FOLDER_PATH
- value: "/home/uab10c1ba4bc/data/vol0/gogs"
- volumeMounts:
- - name: backup
- mountPath: "/root/.ssh/id_rsa"
- subPath: ssh_private_key
- readOnly: true
- - name: backup
- mountPath: "/root/.ssh/id_rsa.pub"
- subPath: ssh_public_key
- readOnly: true
- - name: backup-dir
- mountPath: /mnt
- restartPolicy: Never
- volumes:
- - name: backup
- secret:
- secretName: backup
- defaultMode: 0400
- - name: backup-dir
- hostPath:
- type: DirectoryOrCreate
- path: /tmp/backup
|