Skip to content

Instantly share code, notes, and snippets.

@x86-39
Last active November 2, 2022 23:41
Show Gist options
  • Save x86-39/8dc85624bdf751d9c68ea061b618cad9 to your computer and use it in GitHub Desktop.
Save x86-39/8dc85624bdf751d9c68ea061b618cad9 to your computer and use it in GitHub Desktop.
GitLab Container/Helm Chart Fix

The problem

Postgres seems to not work correctly at the moment. The first deploy will fail since the btree_gist extension requires root to create.

Solution

This can be done manually with the following:

  1. kubectl describe pod gitlab-postgres-0 Get the node this pod is running on, SSH to it
  2. On the worker node, run runc --root /run/containerd/runc/k8s.io/ exec -t --user 0 <CONTAINER ID> psql --user postgres It will prompt for a password, get this password by running: kubectl get secret gitlab-postgresql-password -o jsonpath="{.data['postgresql\-postgres\-password']}" | base64 --decode
  3. You are now in a Postgres shell, run the following: \c gitlabhq_production CREATE EXTENSION IF NOT EXISTS btree_gist; CREATE EXTENSION IF NOT EXISTS pg_trgm;
  4. Redeploy the GitLab container/helm chart and now it should correctly migrate the DB and install GitLab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment