From dcc76f2cab837f9674fc84e92fbfcda82c87d995 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Sat, 22 Oct 2022 20:43:28 +0200 Subject: [PATCH] feat(gitlab): Finish gitlab configuration Add backup documentation for internal backup management --- README.md | 8 ++++---- gitlab/cronjob.yaml | 25 ------------------------- gitlab/deployment.yaml | 2 +- 3 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 gitlab/cronjob.yaml diff --git a/README.md b/README.md index e83a6b3..97f8b67 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ |-------------------------|--------------------------------------|---------------|--------------|------------|----------------------|----------------------|------------------|------------------------|-----------------------------------| | Traefik | Reverse proxy and load balancer | Public* | Socrates | - | - | - | Configured | Configured | Completed | | Vaultwarden | Password manager | Public | Pythagoras-b | MariaDB | - | 4AM K8s CronJob | Configured | Not available | Completed | +| Gitlab | Version control system | Public | Pythagoras-b | PostgreSQL | User created content | 5AM internal CronJob | Configured | Configured | Completed4 | | Adguard | DNS ad blocker and custom DNS server | Private | Socrates | - | - | - | Not configured | Not configured | Pending configuration1 | | Owncloud Infinity Scale | File hosting webUI | Public | Plato | ? | Drive files | Not configured | Configured | Not available | Pending configuration2 | | Synapse | Matrix server - Message centralizer | Public | Pythagoras-b | PostgreSQL | User medias | 4AM K8s CronJob | Configured | Configured | Pending configuration3 | -| Gitlab | Version control system | Public | Pythagoras-b | PostgreSQL | User created content | Not configured | Configured | Configured | Pending configuration4 | | therbron.com | Personal website | Public | Socrates | - | - | - | Not configured | Not configured | Awaiting configuration | | Home assistant | Home automation and monitoring | Private | Pythagoras-a | MariaDB | - | Not configured | Not configured | Not configured | Awaiting configuration | | Vikunja | To-do and Kanban boards | Public | Pythagoras-b | - | - | - | Not configured | Not configured | Migrate to Gitlab | @@ -31,7 +31,7 @@ 1 Missing automated configuration pipeline for environment variable injection
2 Missing configuration for NAS volume mounting (over network)
3 Missing Longhorn scheduling for saving media_store and secret management
-4 Missing `cron` for backup scheduling (require update of the used docker image
+4 Backup management is not handled by k3s but by an internal cronjob rule (Change image name when putting to production)
## Backup management ### Databases @@ -93,5 +93,5 @@ Add longhorn storage classes ### Convert helm chart to k3s manifest `helm template chart stable/chart --output-dir ./chart` -### Gitlab backup command -`gitlab-backup create SKIP=registry,builds,artifacts` +### Gitlab backup process +Because gitlab does not offer the possibility to backup a container's data from an external container, a cronjob has been implemented in the custom image used for deployment. diff --git a/gitlab/cronjob.yaml b/gitlab/cronjob.yaml deleted file mode 100644 index 9ae1fe4..0000000 --- a/gitlab/cronjob.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: batch/v1 -kind: CronJob -metadata: - name: backup-job - namespace: gitlab -spec: - schedule: "0 4 * * *" # Every day at 4AM - concurrencyPolicy: Forbid - jobTemplate: - spec: - template: - spec: - containers: - - name: maria-backup - image: mariadb - command: ["sh", "-c", "echo hi"] - volumeMounts: - - name: gitlab-backup - mountPath: /backup/gitlab - subPath: gitlab - volumes: - - name: gitlab-backup - persistentVolumeClaim: - claimName: gitlab-backup-pvc - restartPolicy: OnFailure diff --git a/gitlab/deployment.yaml b/gitlab/deployment.yaml index 0cf3da8..ae27163 100644 --- a/gitlab/deployment.yaml +++ b/gitlab/deployment.yaml @@ -18,7 +18,7 @@ spec: nodeName: slave-1 containers: - name: gitlab - image: gitlab/gitlab-ce:15.4.2-ce.0 + image: git.halia.dev/athens-school/gitlab:15.5.0-amd64 ports: - containerPort: 80 volumeMounts: