2017-08-17 22:00:37 +05:30
# GitLab Helm Chart
2018-03-17 18:26:18 +05:30
2019-02-15 15:39:39 +05:30
This is the official way to install GitLab on a cloud native environment.
NOTE: **Kubernetes experience required:**
Our Helm charts are recommended for those who are familiar with Kubernetes.
If you're not sure if Kubernetes is for you, our
[Omnibus GitLab packages ](../README.md#install-gitlab-using-the-omnibus-gitlab-package-recommended )
are mature, scalable, support [high availability ](../../administration/high_availability/README.md )
and are used today on GitLab.com.
It is not necessary to have GitLab installed on Kubernetes in order to use [GitLab Kubernetes integration ](https://docs.gitlab.com/ee/user/project/clusters/index.html ).
2018-03-17 18:26:18 +05:30
2018-11-08 19:23:39 +05:30
## Introduction
2018-11-20 20:47:30 +05:30
The `gitlab` chart is the best way to operate GitLab on Kubernetes. This chart
contains all the required components to get started, and can scale to large deployments.
2018-11-08 19:23:39 +05:30
The default deployment includes:
- Core GitLab components: Unicorn, Shell, Workhorse, Registry, Sidekiq, and Gitaly
- Optional dependencies: Postgres, Redis, Minio
- An auto-scaling, unprivileged [GitLab Runner ](https://docs.gitlab.com/runner/ ) using the Kubernetes executor
- Automatically provisioned SSL via [Let's Encrypt ](https://letsencrypt.org/ ).
2018-11-20 20:47:30 +05:30
## Limitations
2018-11-08 19:23:39 +05:30
2018-11-20 20:47:30 +05:30
Some features of GitLab are not currently available:
2018-11-08 19:23:39 +05:30
2018-11-20 20:47:30 +05:30
- [GitLab Pages ](https://gitlab.com/charts/gitlab/issues/37 )
- [GitLab Geo ](https://gitlab.com/charts/gitlab/issues/8 )
- [No in-cluster HA database ](https://gitlab.com/charts/gitlab/issues/48 )
- MySQL will not be supported, as support is [deprecated within GitLab ](https://docs.gitlab.com/omnibus/settings/database.html#using-a-mysql-database-management-server-enterprise-edition-only )
2018-11-08 19:23:39 +05:30
2018-11-20 20:47:30 +05:30
## Installing GitLab using the Helm Chart
The `gitlab` chart includes all required dependencies, and takes a few minutes
to deploy.
TIP: **Tip:**
For production deployments, we strongly recommend using the
2019-02-15 15:39:39 +05:30
[detailed installation instructions ](https://gitlab.com/charts/gitlab/blob/master/doc/installation/index.md )
2018-11-20 20:47:30 +05:30
utilizing [external Postgres, Redis, and object storage ](https://gitlab.com/charts/gitlab/tree/master/doc/advanced ) services.
### Requirements
In order to deploy GitLab on Kubernetes, the following are required:
2018-11-08 19:23:39 +05:30
1. `helm` and `kubectl` [installed on your computer ](preparation/tools_installation.md ).
1. A Kubernetes cluster, version 1.8 or higher. 6vCPU and 16GB of RAM is recommended.
2018-11-20 20:47:30 +05:30
- [Amazon EKS ](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html )
2019-02-15 15:39:39 +05:30
- [Google GKE ](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-container-cluster )
- [IBM IKS ](https://console.bluemix.net/docs/tutorials/scalable-webapp-kubernetes.html#create_kube_cluster )
2018-11-20 20:47:30 +05:30
- [Microsoft AKS ](https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough-portal )
2018-11-08 19:23:39 +05:30
1. A [wildcard DNS entry and external IP address ](preparation/networking.md )
1. [Authenticate and connect ](preparation/connect.md ) to the cluster
1. Configure and initialize [Helm Tiller ](preparation/tiller.md ).
2018-11-20 20:47:30 +05:30
### Deployment of GitLab to Kubernetes
2018-11-08 19:23:39 +05:30
2018-11-20 20:47:30 +05:30
To deploy GitLab, the following three parameters are required:
2018-11-08 19:23:39 +05:30
2018-11-20 20:47:30 +05:30
- `global.hosts.domain` : the [base domain ](preparation/networking.md ) of the
wildcard host entry. For example, `example.com` if the wild card entry is
`*.example.com` .
- `global.hosts.externalIP` : the [external IP ](preparation/networking.md ) which
the wildcard DNS resolves to.
- `certmanager-issuer.email` : the email address to use when requesting new SSL
certificates from Let's Encrypt.
2018-11-08 19:23:39 +05:30
2018-11-20 20:47:30 +05:30
NOTE: **Note:**
For deployments to Amazon EKS, there are
[additional configuration requirements ](preparation/eks.md ). A full list of
configuration options is [also available ](https://gitlab.com/charts/gitlab/blob/master/doc/installation/command-line-options.md ).
2018-11-08 19:23:39 +05:30
2018-11-20 20:47:30 +05:30
Once you have all of your configuration options collected, you can get any
dependencies and run helm. In this example, the helm release is named "gitlab":
2018-11-08 19:23:39 +05:30
2018-11-20 20:47:30 +05:30
```sh
2018-11-08 19:23:39 +05:30
helm repo add gitlab https://charts.gitlab.io/
2018-11-20 20:47:30 +05:30
helm repo update
2018-11-08 19:23:39 +05:30
helm upgrade --install gitlab gitlab/gitlab \
--timeout 600 \
2018-11-20 20:47:30 +05:30
--set global.hosts.domain=example.com \
2018-11-08 19:23:39 +05:30
--set global.hosts.externalIP=10.10.10.10 \
2018-11-20 20:47:30 +05:30
--set certmanager-issuer.email=email@example.com
2018-11-08 19:23:39 +05:30
```
### Monitoring the Deployment
2018-11-20 20:47:30 +05:30
This will output the list of resources installed once the deployment finishes,
which may take 5-10 minutes.
2018-11-08 19:23:39 +05:30
2018-11-20 20:47:30 +05:30
The status of the deployment can be checked by running `helm status gitlab`
which can also be done while the deployment is taking place if you run the
command in another terminal.
2018-11-08 19:23:39 +05:30
### Initial login
2018-11-20 20:47:30 +05:30
You can access the GitLab instance by visiting the domain name beginning with
`gitlab.` followed by the domain specified during installation. From the example
above, the URL would be `https://gitlab.example.com` .
2018-11-08 19:23:39 +05:30
If you manually created the secret for initial root password, you
2018-12-05 23:21:45 +05:30
can use that to sign in as `root` user. If not, GitLab automatically
2018-11-08 19:23:39 +05:30
created a random password for `root` user. This can be extracted by the
following command (replace `<name>` by name of the release - which is `gitlab`
2018-11-20 20:47:30 +05:30
if you used the command above):
2018-11-08 19:23:39 +05:30
2018-11-20 20:47:30 +05:30
```sh
kubectl get secret < name > -gitlab-initial-root-password -ojsonpath={.data.password} | base64 --decode ; echo
2018-11-08 19:23:39 +05:30
```
2018-11-20 20:47:30 +05:30
### Outgoing email
2018-11-08 19:23:39 +05:30
By default outgoing email is disabled. To enable it, provide details for your SMTP server
using the `global.smtp` and `global.email` settings. You can find details for these settings in the
[command line options ](https://gitlab.com/charts/gitlab/blob/master/doc/installation/command-line-options.md#email-configuration ).
If your SMTP server requires authentication make sure to read the section on providing
your password in the [secrets documentation ](https://gitlab.com/charts/gitlab/blob/master/doc/installation/secrets.md#smtp-password ).
You can disable authentication settings with `--set global.smtp.authentication=""` .
2019-02-15 15:39:39 +05:30
If your Kubernetes cluster is on GKE, be aware that SMTP port [25 is blocked ](https://cloud.google.com/compute/docs/tutorials/sending-mail/#using_standard_email_ports ).
2018-11-08 19:23:39 +05:30
2018-11-20 20:47:30 +05:30
### Deploying the Community Edition
2018-11-08 19:23:39 +05:30
To deploy the Community Edition, include these options in your `helm install` command:
2018-11-20 20:47:30 +05:30
```sh
2018-11-08 19:23:39 +05:30
--set gitlab.migrations.image.repository=registry.gitlab.com/gitlab-org/build/cng/gitlab-rails-ce
--set gitlab.sidekiq.image.repository=registry.gitlab.com/gitlab-org/build/cng/gitlab-sidekiq-ce
--set gitlab.unicorn.image.repository=registry.gitlab.com/gitlab-org/build/cng/gitlab-unicorn-ce
2018-11-20 20:47:30 +05:30
--set gitlab.unicorn.workhorse.image=registry.gitlab.com/gitlab-org/build/cng/gitlab-workhorse-ce
--set gitlab.task-runner.image.repository=registry.gitlab.com/gitlab-org/build/cng/gitlab-task-runner-ce
2018-11-08 19:23:39 +05:30
```
## Updating GitLab using the Helm Chart
Once your GitLab Chart is installed, configuration changes and chart updates
should be done using `helm upgrade` :
2018-11-20 20:47:30 +05:30
```sh
helm repo update
helm upgrade --reuse-values gitlab gitlab/gitlab
2018-11-08 19:23:39 +05:30
```
## Uninstalling GitLab using the Helm Chart
To uninstall the GitLab Chart, run the following:
2018-11-20 20:47:30 +05:30
```sh
2018-11-08 19:23:39 +05:30
helm delete gitlab
```
[kube-srv]: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services---service-types
[storageclass]: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#storageclasses