2021-04-06 20:09:26 -04:00
---
stage: Configure
group: Configure
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/#assignments
---
2021-10-27 17:11:33 -04:00
# Cluster integrations (DEPRECATED) **(FREE)**
2022-05-13 23:09:09 -04:00
> - [Deprecated](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) in GitLab 14.5.
> - [Disabled on self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/353410) in GitLab 15.0.
2021-10-27 17:11:33 -04:00
WARNING:
This feature was [deprecated ](https://gitlab.com/groups/gitlab-org/configure/-/epics/8 ) in GitLab 14.5.
2021-04-06 20:09:26 -04:00
2022-05-13 23:09:09 -04:00
FLAG:
On self-managed GitLab, by default this feature is not available. To make it available, ask an administrator to [enable the feature flag ](../../administration/feature_flags.md ) named `certificate_based_clusters` .
2021-04-06 20:09:26 -04:00
GitLab provides several ways to integrate applications to your
Kubernetes cluster.
To enable cluster integrations, first add a Kubernetes cluster to a GitLab
2022-05-05 08:08:03 -04:00
[project ](../project/clusters/index.md ) or
2021-10-27 17:11:33 -04:00
[group ](../group/clusters/index.md ) or
2021-05-13 23:10:11 -04:00
[instance ](../instance/clusters/index.md ).
2021-04-06 20:09:26 -04:00
2021-06-10 17:10:02 -04:00
You can install your applications manually as shown in the following sections, or use the
[Cluster management project template ](management_project_template.md ) that automates the
installation.
Although, the [Cluster management project template ](management_project_template.md ) still
requires that you manually do the last steps of these sections,
[Enable Prometheus integration for your cluster ](#enable-prometheus-integration-for-your-cluster )
or [Enable Elastic Stack integration for your cluster ](#enable-elastic-stack-integration-for-your-cluster )
2021-08-02 20:10:34 -04:00
depending on which application you are installing. [An issue exists ](https://gitlab.com/gitlab-org/gitlab/-/issues/326565 )
to automate this step.
2021-06-10 17:10:02 -04:00
2021-10-20 14:12:31 -04:00
Prometheus and Elastic Stack cluster integrations can only be enabled for clusters [connected through cluster certificates ](../project/clusters/add_existing_cluster.md ).
2022-02-21 19:14:20 -05:00
To enable Prometheus for your cluster connected through the [GitLab agent ](agent/index.md ), you can [integrate it manually ](../project/integrations/prometheus.md#manual-configuration-of-prometheus ).
2021-10-20 14:12:31 -04:00
2022-02-21 19:14:20 -05:00
There is no option to enable Elastic Stack for your cluster if it is connected with the GitLab agent.
2021-10-20 14:12:31 -04:00
Follow this [issue ](https://gitlab.com/gitlab-org/gitlab/-/issues/300230 ) for updates.
2021-04-06 20:09:26 -04:00
## Prometheus cluster integration
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55244) in GitLab 13.11.
2021-10-27 17:11:33 -04:00
WARNING:
This feature was [deprecated ](https://gitlab.com/groups/gitlab-org/configure/-/epics/8 ) in GitLab 14.5. However, you can **still use** Prometheus
for Kubernetes clusters connected to GitLab through the
2022-02-21 19:14:20 -05:00
[agent ](agent/index.md ) by [enabling Prometheus manually ](../project/integrations/prometheus.md#manual-configuration-of-prometheus ).
2021-10-27 17:11:33 -04:00
2021-04-06 20:09:26 -04:00
You can integrate your Kubernetes cluster with
[Prometheus ](https://prometheus.io/ ) for monitoring key metrics of your
apps directly from the GitLab UI.
2021-05-13 23:10:11 -04:00
Once enabled, you can see metrics from services available in the
2021-04-06 20:09:26 -04:00
[metrics library ](../project/integrations/prometheus_library/index.md ).
2021-05-13 23:10:11 -04:00
### Prometheus Prerequisites
2021-04-06 20:09:26 -04:00
2021-05-13 23:10:11 -04:00
To use this integration:
2021-04-06 20:09:26 -04:00
2021-05-13 23:10:11 -04:00
1. Prometheus must be installed in your cluster in the `gitlab-managed-apps` namespace.
2021-04-06 20:09:26 -04:00
1. The `Service` resource for Prometheus must be named `prometheus-prometheus-server` .
2021-05-13 23:10:11 -04:00
You can manage your Prometheus however you like, but as an example, you can set
it up using [Helm ](https://helm.sh/ ) as follows:
2021-04-06 20:09:26 -04:00
```shell
2021-05-13 23:10:11 -04:00
# Create the required Kubernetes namespace
2021-04-06 20:09:26 -04:00
kubectl create ns gitlab-managed-apps
# Download Helm chart values that is compatible with the requirements above.
2021-06-10 17:10:02 -04:00
# These are included in the Cluster Management project template.
wget https://gitlab.com/gitlab-org/project-templates/cluster-management/-/raw/master/applications/prometheus/values.yaml
2021-04-06 20:09:26 -04:00
2021-05-13 23:10:11 -04:00
# Add the Prometheus community Helm chart repository
2021-04-06 20:09:26 -04:00
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
# Install Prometheus
helm install prometheus prometheus-community/prometheus -n gitlab-managed-apps --values values.yaml
```
Alternatively, you can use your preferred installation method to install
Prometheus as long as you meet the requirements above.
### Enable Prometheus integration for your cluster
To enable the Prometheus integration for your cluster:
1. Go to the cluster's page:
- For a [project-level cluster ](../project/clusters/index.md ), navigate to your project's
2021-06-15 20:10:15 -04:00
**Infrastructure > Kubernetes clusters** .
2021-04-06 20:09:26 -04:00
- For a [group-level cluster ](../group/clusters/index.md ), navigate to your group's
**Kubernetes** page.
2021-05-13 23:10:11 -04:00
- For an [instance-level cluster ](../instance/clusters/index.md ), navigate to your instance's
**Kubernetes** page.
1. Select the **Integrations** tab.
1. Check the **Enable Prometheus integration** checkbox.
2022-05-24 17:09:08 -04:00
1. Select **Save changes** .
2021-05-13 23:10:11 -04:00
1. Go to the **Health** tab to see your cluster's metrics.
2022-05-13 08:08:49 -04:00
## Elastic Stack cluster integration **(FREE SELF)**
2021-05-13 23:10:11 -04:00
2022-05-13 08:08:49 -04:00
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61077) in GitLab 13.12.
> - [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/346485) in GitLab 14.7.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/360182) behind a [feature flag](../../administration/feature_flags.md) named `monitor_logging` in GitLab 15.0. Disabled by default.
WARNING:
This feature is in its end-of-life process. It is [deprecated ](https://gitlab.com/gitlab-org/gitlab/-/issues/346485 )
in GitLab 14.7.
It will be removed completely in GitLab 15.2.
FLAG:
On self-managed GitLab, by default this feature is not available. To make it available, ask an administrator to [enable the feature flag ](../../administration/feature_flags.md ) named `monitor_logging` .
On GitLab.com, this feature is not available.
This feature is not recommended for production use.
2021-05-13 23:10:11 -04:00
You can integrate your cluster with [Elastic
2021-07-02 14:08:28 -04:00
Stack](https://www.elastic.co/elastic-stack/) to index and [query your pod
2021-05-13 23:10:11 -04:00
logs](../project/clusters/kubernetes_pod_logs.md).
### Elastic Stack Prerequisites
To use this integration:
1. Elasticsearch 7.x or must be installed in your cluster in the
`gitlab-managed-apps` namespace.
1. The `Service` resource must be called `elastic-stack-elasticsearch-master`
and expose the Elasticsearch API on port `9200` .
2022-03-08 07:20:17 -05:00
1. The logs are expected to be [Filebeat container logs ](https://www.elastic.co/guide/en/beats/filebeat/7.16/filebeat-input-container.html )
following the [7.x log structure ](https://www.elastic.co/guide/en/beats/filebeat/7.16/exported-fields-log.html )
and include [Kubernetes metadata ](https://www.elastic.co/guide/en/beats/filebeat/7.16/add-kubernetes-metadata.html ).
2021-05-13 23:10:11 -04:00
You can manage your Elastic Stack however you like, but as an example, you can
use [this Elastic Stack chart ](https://gitlab.com/gitlab-org/charts/elastic-stack ) to get up and
running:
```shell
# Create the required Kubernetes namespace
kubectl create namespace gitlab-managed-apps
# Download Helm chart values that is compatible with the requirements above.
2021-06-10 17:10:02 -04:00
# These are included in the Cluster Management project template.
wget https://gitlab.com/gitlab-org/project-templates/cluster-management/-/raw/master/applications/elastic-stack/values.yaml
2021-05-13 23:10:11 -04:00
# Add the GitLab Helm chart repository
helm repo add gitlab https://charts.gitlab.io
# Install Elastic Stack
2021-07-15 14:09:37 -04:00
helm install elastic-stack gitlab/elastic-stack -n gitlab-managed-apps --values values.yaml
2021-05-13 23:10:11 -04:00
```
### Enable Elastic Stack integration for your cluster
To enable the Elastic Stack integration for your cluster:
1. Go to the cluster's page:
- For a [project-level cluster ](../project/clusters/index.md ), navigate to your project's
2021-06-15 20:10:15 -04:00
**Infrastructure > Kubernetes clusters** .
2021-05-13 23:10:11 -04:00
- For a [group-level cluster ](../group/clusters/index.md ), navigate to your group's
**Kubernetes** page.
- For an [instance-level cluster ](../instance/clusters/index.md ), navigate to your instance's
**Kubernetes** page.
2021-04-06 20:09:26 -04:00
1. Select the **Integrations** tab.
2021-07-15 14:09:37 -04:00
1. Check the **Enable Elastic Stack integration** checkbox.
2022-05-24 17:09:08 -04:00
1. Select **Save changes** .
2021-04-06 20:09:26 -04:00
1. Go to the **Health** tab to see your cluster's metrics.