[Kubernetes (K8S)] Helm install GitLab for software development and deployment, and project management within Kubernetes (K8S)

GitLab

GitLab is an open source end-to-end software development platform with built-in version control, issue tracking, code review, CI/CD, and more. Self-host GitLab on your own servers, in a container, or on a cloud provider.

GitLab is a fully integrated software development platform that enables your team to be transparent, fast, effective, and cohesive from discussion on a new idea to production, all on the same platform.

GitLab is a Git-based platform that integrates a great number of essential tools for software development and deployment, and project management:

  • Hosting code in repositories with version control.

  • Tracking proposals for new implementations, bug reports, and feedback with a fully featured Issue Tracker.

  • Organizing and prioritizing with Issue Boards.

  • Reviewing code in Merge Requests with live-preview changes per branch with Review Apps.

  • Building, testing, and deploying with built-in Continuous Integration.

  • Deploying personal and professional static websites with GitLab Pages.

  • Integrating with Docker by using GitLab Container Registry.

  • Tracking the development lifecycle by using GitLab Value Stream Analytics.

  • Provide support with Service Desk.

  • Export issues as CSV.

This article is about how to use Helm to deploy GitLab on Kubernetes (K8S).

Prerequisites

  • Kubernetes (K8S)
    Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.

    For more information about installing and using Kubernetes (K8s), see the Kubernetes (K8s) Docs.

  • Helm
    Helm is the best way to find, share, and use software built for Kubernetes.

    For more information about installing and using Helm, see the Helm Docs.

Installation

Custom Values.yaml

Remember to replace content within {{ }} with your prefer values.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# values.yaml

# values.yaml · master · GitLab.org / charts / GitLab Chart · GitLab
# https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/values.yaml

# Deployment Guide | GitLab
# https://docs.gitlab.com/charts/installation/deployment.html

## The global properties are used to configure multiple charts at once.
## Extended documenation at doc/charts/globals.md
global:

## doc/installation/deployment.md#deploy-the-community-edition
edition: ce # ce or ee

hosts:
https: true
domain: { .Values.global.hosts.domain }}
# gitlab:
# name: gitlab-{ .Values.global.hosts.domain }}
# registry:
# name: registry-{ .Values.global.hosts.domain }}
# minio:
# name: minio-gitlab-{ .Values.global.hosts.domain }}
# smartcard:
# name: smartcard-gitlab-{ .Values.global.hosts.domain }}
# kas:
# name: kas-gitlab-{ .Values.global.hosts.domain }}

ingress:
configureCertmanager: false
annotations:
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"

cert-manager.io/acme-challenge-type: dns01
cert-manager.io/cluster-issuer: cert-manager-webhook-dnspod-cluster-issuer

tls:
enabled: true
secretName: { .Values.tls.secretName }}

gitlab:
webservice:
ingress:
tls:
secretName: { .Values.tls.secretName }}

## doc/charts/nginx/index.md
## doc/architecture/decisions.md#nginx-ingress
## Installation & configuration of charts/nginx
nginx-ingress:
enabled: false

## Installation & configuration of jetstack/cert-manager
## See requirements.yaml for current version
certmanager:
createCustomResource: false

install: false

registry:
ingress:
tls:
secretName: { .Values.tls.secretName }}

Install by Helm

Helm install gitlab into gitlab namespace.

1
2
3
4
5
6
7
8
9
10
11
# crate namespace:
$ kubectl create namespace gitlab

# Add the Helm repository:
$ helm repo add gitlab https://charts.gitlab.io/

# Update your local Helm chart repository cache:
$ helm repo update

# To install Helm chart:
$ helm install gitlab gitlab/gitlab --namespace gitlab -f values.yaml

See Helm release about gitlab.

1
2
3
$ helm list --namespace gitlab
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
gitlab gitlab 1 2020-09-19 14:01:49.120598 +0800 +0800 deployed gitlab-4.5.4 13.5.4

See pods about gitlab.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ kubectl get pods -n gitlab
NAME READY STATUS RESTARTS AGE
gitlab-gitaly-0 1/1 Running 0 8h
gitlab-gitlab-exporter-b744ffb55-hbs9w 1/1 Running 0 8h
gitlab-gitlab-runner-5d779f7ddd-cmdfx 1/1 Running 0 8h
gitlab-gitlab-shell-6887b97cf6-f6bq4 1/1 Running 0 8h
gitlab-gitlab-shell-6887b97cf6-k2f6f 1/1 Running 0 8h
gitlab-migrations-1-fsz62 0/1 Completed 0 8h
gitlab-minio-6c8bc78596-7sxkd 1/1 Running 0 8h
gitlab-minio-create-buckets-1-j6pv4 0/1 Completed 0 8h
gitlab-postgresql-0 2/2 Running 0 8h
gitlab-prometheus-server-77948f4459-f88bd 2/2 Running 0 8h
gitlab-redis-master-0 2/2 Running 0 8h
gitlab-registry-767bf88497-js92p 1/1 Running 0 8h
gitlab-registry-767bf88497-xrcn6 1/1 Running 0 8h
gitlab-sidekiq-all-in-1-v1-5c6f8d57bc-rxdnk 0/1 Running 83 6h44m
gitlab-task-runner-7f9f6566f9-clxmm 1/1 Running 0 8h
gitlab-webservice-76cdb5d789-75p5d 2/2 Running 0 8h
gitlab-webservice-76cdb5d789-td6k8 2/2 Running 0 8h

Then, you can visit gitlab server with https://gitlab-{ .Values.global.hosts.domain }}.

References

[1] GitLab cloud native Helm Chart | GitLab - https://docs.gitlab.com/charts/

[2] Quick Start Guide | GitLab - https://docs.gitlab.com/charts/quickstart/index.html

[3] GitLab Docs | GitLab - https://docs.gitlab.com/ce/README.html

[4] Helm - https://helm.sh/

[5] Kubernetes - https://kubernetes.io/