How to customize hostAliases for gitlab toolbox backups?
Summary
How to customize hostAliases for gitlab toolbox backups?
Steps to reproduce
Without DNS configuration, gitlab backups cannot upload backup files
Configuration used
helm repo add gitlab https://charts.gitlab.io
helm repo update
helm upgrade -n gitlab --install helm gitlab/gitlab --timeout 600s -f helm.yaml --version 7.6.2
USER-SUPPLIED VALUES:
USER-SUPPLIED VALUES: null
certmanager-issuer:
email: xuxiaowei@xuxiaowei.com.cn
gitlab:
toolbox:
backups:
cron:
enabled: true
schedule: 0 0 * * *
gitlab-runner:
hostAliases:
- hostnames:
- gitlab.helm.xuxiaowei.com
ip: 172.25.25.22
volumeMounts:
- mountPath: /home/gitlab-runner/.gitlab-runner/certs
name: etc-gitlab-runner-certs-volumes
volumes:
- configMap:
items:
- key: gitlab.helm.xuxiaowei.com.crt
path: gitlab.helm.xuxiaowei.com.crt
name: etc-gitlab-runner-certs
name: etc-gitlab-runner-certs-volumes
global:
edition: ce
hosts:
domain: helm.xuxiaowei.com
minio:
enabled: true
openssl s_client -showcerts -connect gitlab.helm.xuxiaowei.com:443 -servername gitlab.helm.xuxiaowei.com < /dev/null 2>/dev/null | openssl x509 -outform PEM > gitlab.helm.xuxiaowei.com.crt
kubectl -n=gitlab create configmap etc-gitlab-runner-certs --from-file=gitlab.helm.xuxiaowei.com.crt=gitlab.helm.xuxiaowei.com.crt
Current behavior
(What you're experiencing happening)
Expected behavior
(What you're expecting to happen)
Versions
- Chart: (tagged version | branch | hash
git rev-parse HEAD) - Platform:
- Cloud: (GKE | AKS | EKS | ?)
- Self-hosted: (OpenShift | Minikube | Rancher RKE | ?)
- Kubernetes: (
kubectl version)- Client: v1.29.0
- Server: v1.29.0
- Helm: (
helm version)- Client: v3.13.3
- Server:
Relevant logs
[root@k8s-control-plane-1 ~]# kubectl -n gitlab get cj helm-toolbox-backup
NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE
helm-toolbox-backup 0 0 * * * False 0 <none> 38m
[root@k8s-control-plane-1 ~]# kubectl -n gitlab create job --from=cronjob/helm-toolbox-backup manual-backup
job.batch/manual-backup created
[root@k8s-control-plane-1 ~]# kubectl -n gitlab logs -f manual-backup-vdzj8
Defaulted container "toolbox-backup" out of: toolbox-backup, certificates (init), configure (init)
Begin parsing .erb templates from /var/opt/gitlab/templates
Writing /srv/gitlab/config/cable.yml
Writing /srv/gitlab/config/database.yml
Writing /srv/gitlab/config/gitlab.yml
Writing /srv/gitlab/config/resque.yml
Begin parsing .tpl templates from /var/opt/gitlab/templates
Copying other config files found in /var/opt/gitlab/templates to /srv/gitlab/config
Copying smtp_settings.rb into /srv/gitlab/config
Attempting to run '/bin/bash -c cp /etc/gitlab/.s3cfg $HOME/.s3cfg && backup-utility' as a main process
2023-12-18 03:47:03 UTC -- Dumping database ...
pg_dump: warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it
"
Dumping PostgreSQL database gitlabhq_production ... [DONE]
2023-12-18 03:47:05 UTC -- Dumping database ... done
2023-12-18 03:47:05 UTC -- Deleting backup and restore PID file ... done
2023-12-18 03:47:30 UTC -- Dumping repositories ...
2023-12-18 03:47:30 UTC -- Dumping repositories ... done
2023-12-18 03:47:30 UTC -- Deleting backup and restore PID file ... done
Bucket not found: registry. Skipping backup of registry ...
Bucket not found: gitlab-uploads. Skipping backup of uploads ...
Bucket not found: gitlab-artifacts. Skipping backup of artifacts ...
Bucket not found: git-lfs. Skipping backup of lfs ...
Bucket not found: gitlab-packages. Skipping backup of packages ...
Bucket not found: gitlab-mr-diffs. Skipping backup of external_diffs ...
Bucket not found: gitlab-terraform-state. Skipping backup of terraform_state ...
Bucket not found: gitlab-pages. Skipping backup of pages ...
Bucket not found: gitlab-ci-secure-files. Skipping backup of ci_secure_files ...
Packing up backup tar
WARNING: Retrying failed request: /1702871197_2023_12_18_16.6.2_gitlab_backup.tar ([Errno -2] Name or service not known)
WARNING: Waiting 3 sec...
WARNING: Retrying failed request: /1702871197_2023_12_18_16.6.2_gitlab_backup.tar ([Errno -2] Name or service not known)
WARNING: Waiting 6 sec...
WARNING: Retrying failed request: /1702871197_2023_12_18_16.6.2_gitlab_backup.tar ([Errno -2] Name or service not known)
WARNING: Waiting 9 sec...
WARNING: Retrying failed request: /1702871197_2023_12_18_16.6.2_gitlab_backup.tar ([Errno -2] Name or service not known)
WARNING: Waiting 12 sec...
WARNING: Retrying failed request: /1702871197_2023_12_18_16.6.2_gitlab_backup.tar ([Errno -2] Name or service not known)
WARNING: Waiting 15 sec...
ERROR: Upload of '/srv/gitlab/tmp/backup_tars/1702871197_2023_12_18_16.6.2_gitlab_backup.tar' failed too many times (Last reason: Upload failed for: /1702871197_2023_12_18_16.6.2_gitlab_backup.tar)
[root@k8s-control-plane-1 ~]#
Edited by 徐晓伟