Cloud Native 8 min read

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.

Linux Ops Smart Journey
Linux Ops Smart Journey
Linux Ops Smart Journey
Deploy GitLab on Kubernetes in One Click with Helm

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.

GitLab Helm deployment illustration
GitLab Helm deployment illustration

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

GitLab web interface screenshot
GitLab web interface screenshot

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.

cloud nativeCI/CDdeploymentKubernetesDevOpsGitLabHelm
Linux Ops Smart Journey
Written by

Linux Ops Smart Journey

The operations journey never stops—pursuing excellence endlessly.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.