Deploy GitLab on Kubernetes in One Click with Helm
This guide shows how to quickly set up a full GitLab instance on a Kubernetes cluster using Helm charts, covering prerequisite checks, configuration file creation, secret management, and verification steps to streamline CI/CD and team collaboration.
In modern software development, rapid iteration and efficient team collaboration are key; GitLab, an integrated CI/CD, issue tracking, and project‑management platform, is widely adopted, but self‑hosting can be complex. Leveraging Kubernetes and Helm simplifies the installation to a few commands.
Helm and GitLab: A Perfect Match
Helm uses "charts"—pre‑configured Kubernetes resource packages—to simplify application deployment and management. For a complex app like GitLab, a ready‑made chart enables a full instance deployment with just a few commands.
Preparation Before Deployment
Kubernetes + Helm environment is running
Redis is operational
PostgreSQL is operational
Persistent storage (StorageClass) is configured
nginx‑ingress is operational
cert‑manager is operational
Deploy GitLab
1. Create PostgreSQL user and database
<code>$ psql -h 172.139.20.188 -p 9999
# CREATE USER gitlab WITH PASSWORD '123456';
# CREATE DATABASE gitlab_production;
ALTER DATABASE gitlab_production OWNER TO gitlab;</code>2. Pull the GitLab chart
<code>$ sudo helm pull oci://core.jiaxzeng.com/plugins/gitlab --version 7.11.10 --untar --untardir /etc/kubernetes/addons/</code>3. Create the GitLab configuration file
<code>$ cat <<'EOF' | sudo tee /etc/kubernetes/addons/gitlab-values.yaml > /dev/null
global:
edition: ce
hosts:
domain: jiaxzeng.com
https: false
psql:
host: 172.139.20.188
port: 9999
username: gitlab
database: gitlab_production
password:
secret: gitlab-password
key: postgres
redis:
host: 172.139.20.199
port: 6379
auth:
secret: gitlab-password
key: redis
ingress:
class: nginx
configureCertmanager: false
annotations:
cert-manager.io/cluster-issuer: ca-cluster-issuer
monitoring:
enabled: true
certificates:
image:
repository: core.jiaxzeng.com/library/gitlab/certificates
# ... (additional image and component settings) ...
EOF</code>4. Create secrets for Redis and PostgreSQL passwords
<code>$ kubectl -n gitlab create secret generic gitlab-password \
--from-literal=redis=123456 \
--from-literal=postgres=123456</code>5. Deploy GitLab
<code>$ kubectl create namespace gitlab
$ helm -n gitlab install gitlab -f /etc/kubernetes/addons/gitlab-values.yaml /etc/kubernetes/addons/gitlab</code>Validate Services
Check pod status
<code>$ kubectl -n gitlab get pod
NAME READY STATUS RESTARTS AGE
gitlab-gitaly-0 1/1 Running 0 77m
gitlab-gitlab-exporter-... 1/1 Running 0 77m
... (other pods) ...</code>Browse GitLab
Conclusion
Deploying GitLab with Helm eliminates many traditional installation challenges, giving users greater autonomy and flexibility. The guide walks through environment preparation, configuration, secret handling, and deployment, demonstrating how modern cloud‑native tools accelerate DevOps transformation and improve team efficiency.
Linux Ops Smart Journey
The operations journey never stops—pursuing excellence endlessly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.