Cluster integrations (FREE)
GitLab provides several ways to integrate applications to your Kubernetes cluster.
To enable cluster integrations, first add a Kubernetes cluster to a GitLab project or group or instance.
Prometheus cluster integration
Introduced in GitLab 13.11.
You can integrate your Kubernetes cluster with Prometheus for monitoring key metrics of your apps directly from the GitLab UI.
Alerts can be configured the same way as for external Prometheus instances.
Once enabled, you can see metrics from services available in the metrics library.
Prometheus Prerequisites
To use this integration:
- Prometheus must be installed in your cluster in the
gitlab-managed-apps
namespace. - The
Service
resource for Prometheus must be namedprometheus-prometheus-server
.
You can manage your Prometheus however you like, but as an example, you can set it up using Helm as follows:
# Create the required Kubernetes namespace
kubectl create ns gitlab-managed-apps
# Download Helm chart values that is compatible with the requirements above.
# You should substitute the tag that corresponds to the GitLab version in the URL
# - https://gitlab.com/gitlab-org/gitlab/-/raw/<tag>/vendor/prometheus/values.yaml
#
wget https://gitlab.com/gitlab-org/gitlab/-/raw/v13.9.0-ee/vendor/prometheus/values.yaml
# Add the Prometheus community Helm chart repository
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:
- Go to the cluster's page:
- For a project-level cluster, navigate to your project's Operations > Kubernetes.
- For a group-level cluster, navigate to your group's Kubernetes page.
- For an instance-level cluster, navigate to your instance's Kubernetes page.
- Select the Integrations tab.
- Check the Enable Prometheus integration checkbox.
- Click Save changes.
- Go to the Health tab to see your cluster's metrics.
Elastic Stack cluster integration
Introduced in GitLab 13.12.
You can integrate your cluster with Elastic Stack to index and query your pod logs.
Elastic Stack Prerequisites
To use this integration:
- Elasticsearch 7.x or must be installed in your cluster in the
gitlab-managed-apps
namespace. - The
Service
resource must be calledelastic-stack-elasticsearch-master
and expose the Elasticsearch API on port9200
. - The logs are expected to be Filebeat container logs following the 7.x log structure and include Kubernetes metadata.
You can manage your Elastic Stack however you like, but as an example, you can use this Elastic Stack chart to get up and running:
# Create the required Kubernetes namespace
kubectl create namespace gitlab-managed-apps
# Download Helm chart values that is compatible with the requirements above.
# You should substitute the tag that corresponds to the GitLab version in the URL
# - https://gitlab.com/gitlab-org/gitlab/-/raw/<tag>/vendor/elastic_stack/values.yaml
#
wget https://gitlab.com/gitlab-org/gitlab/-/raw/v13.9.0-ee/vendor/elastic_stack/values.yaml
# Add the GitLab Helm chart repository
helm repo add gitlab https://charts.gitlab.io
# Install Elastic Stack
helm install prometheus gitlab/elastic-stack -n gitlab-managed-apps --values values.yaml
Enable Elastic Stack integration for your cluster
To enable the Elastic Stack integration for your cluster:
- Go to the cluster's page:
- For a project-level cluster, navigate to your project's Operations > Kubernetes.
- For a group-level cluster, navigate to your group's Kubernetes page.
- For an instance-level cluster, navigate to your instance's Kubernetes page.
- Select the Integrations tab.
- Check the Enable Prometheus integration checkbox.
- Click Save changes.
- Go to the Health tab to see your cluster's metrics.