GitLab Documentation

GitLab Kubernetes / OpenShift integration

GitLab can be configured to interact with Kubernetes, or other systems using the Kubernetes API (such as OpenShift).

Each project can be configured to connect to a different Kubernetes cluster, see the configuration section.

Configuration

Navigate to the Integrations page of your project and select the Kubernetes service to configure it. Fill in all the needed parameters, check the "Active" checkbox and hit Save changes for the changes to take effect.

Kubernetes configuration settings

The Kubernetes service takes the following parameters:

Tip: If you have a single cluster that you want to use for all your projects, you can pre-fill the settings page with a default template. To configure the template, see Services Templates.

Deployment variables

The Kubernetes service exposes the following deployment variables in the GitLab CI/CD build environment:

What you can get with the Kubernetes integration

Here's what you can do with GitLab if you enable the Kubernetes integration.

Deploy Boards (EEP)

Available in GitLab Enterprise Edition Premium.

GitLab's Deploy Boards offer a consolidated view of the current health and status of each CI environment running on Kubernetes, displaying the status of the pods in the deployment. Developers and other teammates can view the progress and status of a rollout, pod by pod, in the workflow they already use without any need to access Kubernetes.

> Read more about Deploy Boards

Canary Deployments (EEP)

Available in GitLab Enterprise Edition Premium.

Leverage Kubernetes' Canary deployments and visualize your canary deployments right inside the Deploy Board, without the need to leave GitLab.

> Read more about Canary Deployments

Kubernetes monitoring

Automatically detect and monitor Kubernetes metrics. Automatic monitoring of NGINX ingress is also supported.

> Read more about Kubernetes monitoring

Auto DevOps

Auto DevOps automatically detects, builds, tests, deploys, and monitors your applications.

To make full use of Auto DevOps(Auto Deploy, Auto Review Apps, and Auto Monitoring) you will need the Kubernetes project integration enabled.

> Read more about Auto DevOps

Web terminals

Note: Introduced in GitLab 8.15. You must be the project owner or have master permissions to use terminals. Support is limited to the first container in the first pod of your environment.

When enabled, the Kubernetes service adds web terminal support to your environments. This is based on the exec functionality found in Docker and Kubernetes, so you get a new shell session within your existing containers. To use this integration, you should deploy to Kubernetes using the deployment variables above, ensuring any pods you create are labelled with app=$CI_ENVIRONMENT_SLUG. GitLab will do the rest!



Last updated 2017-09-25

Leave a comment below if you have any feedback on the documentation. For support and other inquires, see getting help.