2020-05-29 14:08:26 -04:00
---
stage: Release
group: Progressive Delivery
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
type: howto, reference
---
2019-07-08 04:50:38 -04:00
# Deploy Boards **(PREMIUM)**
2019-05-05 11:37:18 -04:00
2020-05-21 23:08:28 -04:00
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1589) in [GitLab Premium](https://about.gitlab.com/pricing/) 9.0.
2019-05-05 11:37:18 -04:00
GitLab's Deploy Boards offer a consolidated view of the current health and
2020-05-15 14:07:52 -04:00
status of each CI [environment ](../../ci/environments/index.md ) running on [Kubernetes ](https://kubernetes.io ), displaying the status
2019-05-05 11:37:18 -04:00
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.
## Overview
With Deploy Boards you can gain more insight into deploys with benefits such as:
- Following a deploy from the start, not just when it's done
- Watching the rollout of a build across multiple servers
2019-11-29 04:06:31 -05:00
- Finer state detail (Succeeded, Running, Failed, Pending, Unknown)
2019-05-05 11:37:18 -04:00
- See [Canary Deployments ](canary_deployments.md )
Here's an example of a Deploy Board of the production environment.
![Deploy Boards landing page ](img/deploy_boards_landing_page.png )
The squares represent pods in your Kubernetes cluster that are associated with
the given environment. Hovering above each square you can see the state of a
deploy rolling out. The percentage is the percent of the pods that are updated
to the latest release.
Since Deploy Boards are tightly coupled with Kubernetes, there is some required
2020-02-11 10:08:44 -05:00
knowledge. In particular, you should be familiar with:
2019-05-05 11:37:18 -04:00
2020-08-06 11:09:42 -04:00
- [Kubernetes pods ](https://kubernetes.io/docs/concepts/workloads/pods/ )
2019-05-05 11:37:18 -04:00
- [Kubernetes labels ](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ )
2019-10-09 20:06:44 -04:00
- [Kubernetes namespaces ](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ )
2019-05-05 11:37:18 -04:00
- [Kubernetes canary deployments ](https://kubernetes.io/docs/concepts/cluster-administration/manage-deployment/#canary-deployments )
2020-06-08 14:08:27 -04:00
NOTE: **Note:**
Apps that consist of multiple deployments are shown as duplicates on the deploy board.
Follow [this issue ](https://gitlab.com/gitlab-org/gitlab/-/issues/8463 ) for details.
2019-05-05 11:37:18 -04:00
## Use cases
Since the Deploy Board is a visual representation of the Kubernetes pods for a
2020-02-11 10:08:44 -05:00
specific environment, there are a lot of use cases. To name a few:
2019-05-05 11:37:18 -04:00
- You want to promote what's running in staging, to production. You go to the
environments list, verify that what's running in staging is what you think is
running, then click on the [manual action ](../../ci/yaml/README.md#whenmanual ) to deploy to production.
- You trigger a deploy, and you've got lots of containers to upgrade so you know
it'll take a while (you've also throttled your deploy to only take down X
containers at a time). But you need to tell someone when it's deployed, so you
go to the environments list, look at the production environment to see what
the progress is in real-time as each pod is rolled.
- You get a report that something is weird in production, so you look at the
production environment to see what is running, and if a deploy is ongoing or
stuck or failed.
- You've got an MR that looks good, but you want to run it on staging because
staging is set up in some way closer to production. You go to the environment
2020-03-30 23:07:51 -04:00
list, find the [Review App ](../../ci/review_apps/index.md ) you're interested in, and click the
2019-05-05 11:37:18 -04:00
manual action to deploy it to staging.
## Enabling Deploy Boards
2020-05-15 14:07:52 -04:00
To display the Deploy Boards for a specific [environment ](../../ci/environments/index.md ) you should:
2019-05-05 11:37:18 -04:00
2020-05-15 14:07:52 -04:00
1. Have [defined an environment ](../../ci/environments/index.md#defining-environments ) with a deploy stage.
2019-06-20 18:40:25 -04:00
2019-05-05 11:37:18 -04:00
1. Have a Kubernetes cluster up and running.
2019-07-14 23:02:30 -04:00
NOTE: **Running on OpenShift:**
If you are using OpenShift, ensure that you're using the `Deployment` resource
2020-02-11 10:08:44 -05:00
instead of `DeploymentConfiguration` . Otherwise, the Deploy Boards won't render
2019-07-14 23:02:30 -04:00
correctly. For more information, read the
[OpenShift docs ](https://docs.openshift.com/container-platform/3.7/dev_guide/deployments/kubernetes_deployments.html#kubernetes-deployments-vs-deployment-configurations )
2020-05-21 23:08:28 -04:00
and [GitLab issue #4584 ](https://gitlab.com/gitlab-org/gitlab/-/issues/4584 ).
2019-05-05 11:37:18 -04:00
2020-03-30 23:07:51 -04:00
1. [Configure GitLab Runner ](../../ci/runners/README.md ) with the [Docker ](https://docs.gitlab.com/runner/executors/docker.html ) or
[Kubernetes ](https://docs.gitlab.com/runner/executors/kubernetes.html ) executor.
1. Configure the [Kubernetes integration ](clusters/index.md ) in your project for the
2019-05-05 11:37:18 -04:00
cluster. The Kubernetes namespace is of particular note as you will need it
for your deployment scripts (exposed by the `KUBE_NAMESPACE` env variable).
1. Ensure Kubernetes annotations of `app.gitlab.com/env: $CI_ENVIRONMENT_SLUG`
and `app.gitlab.com/app: $CI_PROJECT_PATH_SLUG` are applied to the
deployments, replica sets, and pods, where `$CI_ENVIRONMENT_SLUG` and
`$CI_PROJECT_PATH_SLUG` are the values of the CI variables. This is so we can
lookup the proper environment in a cluster/namespace which may have more
than one. These resources should be contained in the namespace defined in
2020-04-06 20:09:33 -04:00
the Kubernetes service setting. You can use an [Autodeploy ](../../topics/autodevops/stages.md#auto-deploy ) `.gitlab-ci.yml`
2019-05-05 11:37:18 -04:00
template which has predefined stages and commands to use, and automatically
applies the annotations. Each project will need to have a unique namespace in
Kubernetes as well. The image below demonstrates how this is shown inside
Kubernetes.
NOTE: **Note:**
2019-06-19 19:22:28 -04:00
Matching based on the Kubernetes `app` label was removed in [GitLab
2020-02-06 10:09:11 -05:00
12.1](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/14020).
2019-06-19 19:22:28 -04:00
To migrate, please apply the required annotations (see above) and
2019-09-29 20:06:04 -04:00
re-deploy your application. If you are using Auto DevOps, this will
be done automatically and no action is necessary.
2019-05-05 11:37:18 -04:00
2019-07-14 23:02:30 -04:00
![Deploy Boards Kubernetes Label ](img/deploy_boards_kubernetes_label.png )
2019-05-05 11:37:18 -04:00
Once all of the above are set up and the pipeline has run at least once,
navigate to the environments page under **Operations > Environments** .
Deploy Boards are visible by default. You can explicitly click
the triangle next to their respective environment name in order to hide them.
2020-03-26 05:07:52 -04:00
### Example manifest file
The following example is an extract of a Kubernetes manifest deployment file, using the two annotations `app.gitlab.com/env` and `app.gitlab.com/app` to enable the **Deploy Boards** :
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: "APPLICATION_NAME"
annotations:
app.gitlab.com/app: ${CI_PROJECT_PATH_SLUG}
2020-05-15 14:07:52 -04:00
app.gitlab.com/env: ${CI_ENVIRONMENT_SLUG}
2020-03-26 05:07:52 -04:00
spec:
replicas: 1
selector:
matchLabels:
app: "APPLICATION_NAME"
template:
metadata:
labels:
app: "APPLICATION_NAME"
annotations:
app.gitlab.com/app: ${CI_PROJECT_PATH_SLUG}
app.gitlab.com/env: ${CI_ENVIRONMENT_SLUG}
```
The annotations will be applied to the deployments, replica sets, and pods. By changing the number of replicas, like `kubectl scale --replicas=3 deploy APPLICATION_NAME -n ${KUBE_NAMESPACE}` , you can follow the instances' pods from the board.
2020-04-21 20:09:24 -04:00
NOTE: **Note:**
The YAML file is static. If you apply it using `kubectl apply` , you must
manually provide the project and environment slugs, or create a script to
replace the variables in the YAML before applying.
2019-05-05 11:37:18 -04:00
## Canary Deployments
A popular CI strategy, where a small portion of the fleet is updated to the new
version of your application.
[Read more about Canary Deployments. ](canary_deployments.md )
## Further reading
2020-04-06 20:09:33 -04:00
- [GitLab Autodeploy ](../../topics/autodevops/stages.md#auto-deploy )
2020-03-30 23:07:51 -04:00
- [GitLab CI/CD environment variables ](../../ci/variables/README.md )
2020-05-15 14:07:52 -04:00
- [Environments and deployments ](../../ci/environments/index.md )
2020-03-30 23:07:51 -04:00
- [Kubernetes deploy example ](https://gitlab.com/gitlab-examples/kubernetes-deploy )