Deploy GitLab CE on a new Azure Kubernetes cluster

I would like to share my experience to create a small Kubernetes cluster on Azure Container Service (AKS Preview) and deploy GitLab CE on it using the Helm chart.

  • There is no way from Azure CLI to understand, which VM sizes are available in which region. Definitely, not all VM sizes can be used in AKS and in different regions the set of available VM sizes is different. It is OK when someone else pays for your Azure subscription, but using your own freemium subscription or paying out of own pocket might end up not so well.
  • You need a cluster with at least three nodes, since smaller VMs have limitations on how many data volumes can be attached to them and GitLab uses quite a few persistent volumes.
az group create --name ubiquitous --location eastus
az aks create --resource-group ubiquitous --name ubiquitous --node-count 3 --generate-ssh-keys --node-vm-size Standard_B2s
az aks get-credentials -g ubiquitous -n ubiquitous
helm init
helm repo add gitlab https://charts.gitlab.io
helm install --name gitlab --set baseDomain=app.ubiquitous.no,gitlab=ce,legoEmail=dummy@ubiquitous.no,provider=acs gitlab/gitlab-omnibus
kubectl get svc -w --namespace nginx-ingress nginx
A   *.app.ubiquitous.no   23.96.2.189
  • GitLab Runner for Kubernetes, which is used to build and deploy your applications using the CI/CD pipeline.
  • GitLab Docker Registry, allowing you to host Docker images in individual Docker repositories for each project.
  • Mattermost chat system.
  • Prometheus time-series database, which will collect metrics for GitLab itself and for pods that the CI pipeline will deploy.
kubectl port-forward svc/gitlab-gitlab 9090:9090
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
gitlab-gitlab-764bd7665-w94t6 1/1 Running 1 22h
gitlab-gitlab-postgresql-5fff4f67bb-lp74p 1/1 Running 0 22h
gitlab-gitlab-redis-6c88945d56-gm5qc 1/1 Running 0 22h
gitlab-gitlab-runner-f7c85548-bl8c5 1/1 Running 7 22h
kubectl exec -it gitlab-gitlab-764bd7665-w94t6 -- /bin/bash
vim /etc/gitlab/gitlab.rb
gitlab-ctl reconfigure
gitlab-ctl restart

Alexey is the Event Sourcing and Domain-Driven Design enthusiast and promoter. He works as a Developer Advocate at Event Store and Chief Architect at ABAX.