- Passwords and secrets failing or unsynchronized
- Database is broken and needs reset
- Backup used for testing needs to be updated
Troubleshooting
All steps noted here are for DEVELOPMENT ENVIRONMENTS ONLY. Administrators may find the information insightful, but the outlined fixes are destructive and would have a major negative impact on production systems.
Passwords and secrets failing or unsynchronized
Developers commonly deploy, delete, and re-deploy a release into the same
cluster multiple times. Kubernetes secrets and persistent volume claims created by StatefulSets are
intentionally not removed by helm delete RELEASE_NAME.
Removing only the Kubernetes secrets leads to interesting problems. For example, a new deployment’s migration pod will fail because GitLab Rails cannot connect to the database because it has the wrong password.
To completely wipe a release from a development environment including secrets, a developer must remove both the secrets and the persistent volume claims.
# DO NOT run these commands in a production environment. Disaster will strike.
kubectl delete secrets,pvc -lrelease=RELEASE_NAME
Database is broken and needs reset
The database environment can be reset in a development environment by:
- Delete the PostgreSQL StatefulSet
- Delete the PostgreSQL PersistentVolumeClaim
- Deploy GitLab again with
helm upgrade --install
Backup used for testing needs to be updated
Certain jobs in CI use a backup of GitLab during testing. Complete the steps below to update this backup when needed:
- Generate the desired backup by running a CI pipeline for the matching stable branch.
- For example: run a CI pipeline for branch
5-4-stableif current release is5-5-stableto create a backup of 14.4. - Note that this will require the Maintainer role.
- For example: run a CI pipeline for branch
gitlab-runner Deployment replicas to 0, so the Runner turns off.
toolbox Pod to ensure there is no existing tmp data, keeping the backup small.
toolbox Pod.
gitlab-backups bucket.
- Project:
cloud-native-182609, path:gitlab-charts-ci/test-backups/ - Name format:
$VERSION_gitlab_backup.tar(example:14.4.2_gitlab_backup.tar) - Edit access and add
Entity=Public,Name=allUsers, andAccess=Reader.
.variables.TEST_BACKUP_PREFIX in .gitlab-ci.yml to the new version of the backup.
Future pipelines will now use the new backup artifact during testing.