Commit f770bce4 authored by Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason

Remove GitLab-managed applications UI

Part of https://gitlab.com/gitlab-org/gitlab/-/issues/293583

Changelog: removed
parent a237a266
...@@ -41,17 +41,10 @@ export default { ...@@ -41,17 +41,10 @@ export default {
toggleEnabled: true, toggleEnabled: true,
envScope: '*', envScope: '*',
baseDomainField: '', baseDomainField: '',
externalIp: '',
}; };
}, },
computed: { computed: {
...mapState([ ...mapState(['enabled', 'editable', 'environmentScope', 'baseDomain']),
'enabled',
'editable',
'environmentScope',
'baseDomain',
'applicationIngressExternalIp',
]),
canSubmit() { canSubmit() {
return ( return (
this.enabled !== this.toggleEnabled || this.enabled !== this.toggleEnabled ||
...@@ -64,7 +57,6 @@ export default { ...@@ -64,7 +57,6 @@ export default {
this.toggleEnabled = this.enabled; this.toggleEnabled = this.enabled;
this.envScope = this.environmentScope; this.envScope = this.environmentScope;
this.baseDomainField = this.baseDomain; this.baseDomainField = this.baseDomain;
this.externalIp = this.applicationIngressExternalIp;
}, },
}; };
</script> </script>
...@@ -135,13 +127,6 @@ export default { ...@@ -135,13 +127,6 @@ export default {
<gl-link :href="autoDevopsHelpPath" target="_blank">{{ content }}</gl-link> <gl-link :href="autoDevopsHelpPath" target="_blank">{{ content }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
<div v-if="applicationIngressExternalIp" class="js-ingress-domain-help-text inline">
{{ s__('ClusterIntegration|Alternatively, ') }}
<gl-sprintf :message="s__('ClusterIntegration|%{externalIp}.nip.io')">
<template #externalIp>{{ externalIp }}</template>
</gl-sprintf>
{{ s__('ClusterIntegration|can be used instead of a custom domain. ') }}
</div>
<gl-sprintf <gl-sprintf
class="inline" class="inline"
:message="s__('ClusterIntegration|%{linkStart}More information%{linkEnd}')" :message="s__('ClusterIntegration|%{linkStart}More information%{linkEnd}')"
......
...@@ -6,7 +6,6 @@ export default (initialState = {}) => { ...@@ -6,7 +6,6 @@ export default (initialState = {}) => {
editable: parseBoolean(initialState.editable), editable: parseBoolean(initialState.editable),
environmentScope: initialState.environmentScope, environmentScope: initialState.environmentScope,
baseDomain: initialState.baseDomain, baseDomain: initialState.baseDomain,
applicationIngressExternalIp: initialState.applicationIngressExternalIp,
autoDevopsHelpPath: initialState.autoDevopsHelpPath, autoDevopsHelpPath: initialState.autoDevopsHelpPath,
externalEndpointHelpPath: initialState.externalEndpointHelpPath, externalEndpointHelpPath: initialState.externalEndpointHelpPath,
}; };
......
...@@ -27,9 +27,6 @@ ...@@ -27,9 +27,6 @@
provider_type: @cluster.provider_type, provider_type: @cluster.provider_type,
pre_installed_knative: @cluster.knative_pre_installed? ? 'true': 'false', pre_installed_knative: @cluster.knative_pre_installed? ? 'true': 'false',
help_path: help_page_path('user/project/clusters/index.md'), help_path: help_page_path('user/project/clusters/index.md'),
helm_help_path: help_page_path('user/clusters/applications.md', anchor: 'helm'),
ingress_help_path: help_page_path('user/clusters/applications.md', anchor: 'determining-the-external-endpoint-automatically'),
ingress_dns_help_path: help_page_path('user/clusters/applications.md', anchor: 'pointing-your-dns-at-the-external-endpoint'),
environments_help_path: help_page_path('ci/environments/index.md', anchor: 'create-a-static-environment'), environments_help_path: help_page_path('ci/environments/index.md', anchor: 'create-a-static-environment'),
clusters_help_path: help_page_path('user/project/clusters/index.md', anchor: 'deploying-to-a-kubernetes-cluster'), clusters_help_path: help_page_path('user/project/clusters/index.md', anchor: 'deploying-to-a-kubernetes-cluster'),
deploy_boards_help_path: help_page_path('user/project/deploy_boards.md', anchor: 'enabling-deploy-boards'), deploy_boards_help_path: help_page_path('user/project/deploy_boards.md', anchor: 'enabling-deploy-boards'),
...@@ -51,13 +48,20 @@ ...@@ -51,13 +48,20 @@
= render 'banner' = render 'banner'
.gl-alert.gl-alert-warning{ role: 'alert' }
= sprite_icon('warning', css_class: "gl-alert-icon gl-alert-icon-no-title gl-icon")
%button.js-close.gl-alert-dismiss{ type: 'button', 'aria-label' => _('Dismiss'), data: { testid: 'dismiss-one-click-application-removal' } }
= sprite_icon('close', css_class: 'gl-icon')
.gl-alert-body
= s_('ClusterApplicationsRemoved|One-click application management was removed in GitLab 14.0. Your applications are still installed in your cluster, and integrations continue working.')
= link_to _('More information.'), help_page_path("user/clusters/applications"), target: '_blank'
- if cluster_created?(@cluster) - if cluster_created?(@cluster)
.js-toggle-container .js-toggle-container
%ul.nav-links.mobile-separator.nav.nav-tabs{ role: 'tablist' } %ul.nav-links.mobile-separator.nav.nav-tabs{ role: 'tablist' }
= render 'details_tab' = render 'details_tab'
= render_if_exists 'clusters/clusters/environments_tab' = render_if_exists 'clusters/clusters/environments_tab'
= render 'clusters/clusters/health_tab' = render 'clusters/clusters/health_tab'
= render 'applications_tab'
= render 'integrations_tab' = render 'integrations_tab'
= render 'advanced_settings_tab' = render 'advanced_settings_tab'
......
...@@ -215,7 +215,7 @@ click NodeExporter "./architecture.html#node-exporter" ...@@ -215,7 +215,7 @@ click NodeExporter "./architecture.html#node-exporter"
### Component legend ### Component legend
- ✅ - Installed by default - ✅ - Installed by default
- ⚙ - Requires additional configuration, or GitLab Managed Apps - ⚙ - Requires additional configuration
- ⤓ - Manual installation required - ⤓ - Manual installation required
- ❌ - Not supported or no instructions available - ❌ - Not supported or no instructions available
- N/A - Not applicable - N/A - Not applicable
......
...@@ -73,7 +73,7 @@ production services. GitLab provides centralized, aggregated log storage for you ...@@ -73,7 +73,7 @@ production services. GitLab provides centralized, aggregated log storage for you
distributed application, enabling you to collect logs across multiple services and distributed application, enabling you to collect logs across multiple services and
infrastructure. infrastructure.
- [View logs of pods or managed applications](../user/project/clusters/kubernetes_pod_logs.md) - [View logs of pods](../user/project/clusters/kubernetes_pod_logs.md)
in connected Kubernetes clusters. in connected Kubernetes clusters.
## Manage your infrastructure in code ## Manage your infrastructure in code
......
...@@ -217,8 +217,46 @@ links: ...@@ -217,8 +217,46 @@ links:
## Troubleshooting ## Troubleshooting
When troubleshooting issues with a managed Prometheus app, it is often useful to ### Accessing the UI of Prometheus in Kubernetes
[view the Prometheus UI](../../../user/project/integrations/prometheus.md#access-the-ui-of-a-prometheus-managed-application-in-kubernetes).
When troubleshooting issues with an in-cluster Prometheus, it can help to
view the Prometheus UI. In the example below, we assume the Prometheus
server to be the pod `prometheus-prometheus-server` in the `gitlab-managed-apps`
namespace:
1. Find the name of the Prometheus pod in the user interface of your Kubernetes
provider, such as GKE, or by running the following `kubectl` command in your
terminal. For example:
```shell
kubectl get pods -n gitlab-managed-apps | grep 'prometheus-prometheus-server'
```
The command should return a result like the following example, where
`prometheus-prometheus-server-55b4bd64c9-dpc6b` is the name of the Prometheus pod:
```plaintext
gitlab-managed-apps prometheus-prometheus-server-55b4bd64c9-dpc6b 2/2 Running 0 71d
```
1. Run a `kubectl port-forward` command. In the following example, `9090` is the
Prometheus server's listening port:
```shell
kubectl port-forward prometheus-prometheus-server-55b4bd64c9-dpc6b 9090:9090 -n gitlab-managed-apps
```
The `port-forward` command forwards all requests sent to your system's `9090` port
to the `9090` port of the Prometheus pod. If the `9090` port on your system is used
by another application, you can change the port number before the colon to your
desired port. For example, to forward port `8080` of your local system, change the
command to:
```shell
kubectl port-forward prometheus-prometheus-server-55b4bd64c9-dpc6b 8080:9090 -n gitlab-managed-apps
```
1. Open `localhost:9090` in your browser to display the Prometheus user interface.
### "No data found" error on Metrics dashboard page ### "No data found" error on Metrics dashboard page
......
...@@ -16,10 +16,10 @@ critical. For GitLab to display your information in charts, you must: ...@@ -16,10 +16,10 @@ critical. For GitLab to display your information in charts, you must:
For an overview, see [How to instrument Prometheus metrics in GitLab](https://www.youtube.com/watch?v=tuI2oJ3TTB4). For an overview, see [How to instrument Prometheus metrics in GitLab](https://www.youtube.com/watch?v=tuI2oJ3TTB4).
1. **Expose metrics for capture** - Make logs, metrics, and traces available for capture. 1. **Expose metrics for capture** - Make logs, metrics, and traces available for capture.
1. [**Configure Prometheus to gather metrics**](#configure-prometheus-to-gather-metrics) - 1. [**Configure Prometheus to gather metrics**](#configure-prometheus-to-gather-metrics) -
Deploy managed applications like Elasticsearch, Prometheus, and Jaeger to gather Use applications like Elasticsearch, Prometheus, and Jaeger to gather
the data you've exposed. the data you've exposed.
1. **GitLab collects metrics** - GitLab uses Prometheus to scrape the data you've 1. **GitLab collects metrics** - GitLab uses Prometheus to scrape the data you've
captured in your managed apps, and prepares the data for display. To learn more, read captured in your applications, and prepares the data for display. To learn more, read
[Collect and process metrics](#collect-and-process-metrics). [Collect and process metrics](#collect-and-process-metrics).
1. **Display charts in the GitLab user interface** - GitLab converts your metrics 1. **Display charts in the GitLab user interface** - GitLab converts your metrics
into easy-to-read charts on a default dashboard. You can create as many custom charts into easy-to-read charts on a default dashboard. You can create as many custom charts
...@@ -34,30 +34,10 @@ your Prometheus integration depends on where your apps are running: ...@@ -34,30 +34,10 @@ your Prometheus integration depends on where your apps are running:
- **For manually-configured Prometheus** - - **For manually-configured Prometheus** -
[Specify your Prometheus server](../../user/project/integrations/prometheus.md#manual-configuration-of-prometheus), [Specify your Prometheus server](../../user/project/integrations/prometheus.md#manual-configuration-of-prometheus),
and define at least one environment. and define at least one environment.
- **For GitLab-managed Prometheus** - GitLab can - **For a cluster integrated Prometheus** - GitLab can query
[deploy and manage Prometheus](../../user/project/integrations/prometheus.md#managed-prometheus-on-kubernetes) for you. [an in-cluster Prometheus](../../user/clusters/integrations.md#prometheus-cluster-integration).
You must also complete a code deployment, as described in You must also complete a code deployment to your cluster for the **Operations > Metrics**
[Deploy code with GitLab-managed Prometheus](#deploy-code-with-gitlab-managed-prometheus), page to contain data. You can do this using [Auto DevOps](../../topics/autodevops/quick_start_guide.md).
for the **Operations > Metrics** page to contain data.
### Deploy code with GitLab-managed Prometheus
For GitLab-managed Prometheus, you can set up [Auto DevOps](../../topics/autodevops/index.md)
to quickly create a deployment:
1. Navigate to your project's **Operations > Kubernetes** page.
1. Ensure that, in addition to Prometheus, you also have GitLab Runner and Ingress
installed.
1. After installing Ingress, copy its endpoint.
1. Navigate to your project's **Settings > CI/CD** page. In the
**Auto DevOps** section, select a deployment strategy and save your changes.
1. On the same page, in the **Variables** section, add a variable named
`KUBE_INGRESS_BASE_DOMAIN` with the value of the Ingress endpoint you
copied previously. Leave the type as **Variable**.
1. Navigate to your project's **{rocket}** **CI/CD > Pipelines** page, and run a
pipeline on any branch.
1. When the pipeline has run successfully, graphs are available on the
**Operations > Metrics** page.
![Monitoring Dashboard](img/prometheus_monitoring_dashboard_v13_3.png) ![Monitoring Dashboard](img/prometheus_monitoring_dashboard_v13_3.png)
......
...@@ -66,8 +66,7 @@ To make full use of Auto DevOps with Kubernetes, you need: ...@@ -66,8 +66,7 @@ To make full use of Auto DevOps with Kubernetes, you need:
Runners should be registered as [shared runners](../../ci/runners/runners_scope.md#shared-runners) Runners should be registered as [shared runners](../../ci/runners/runners_scope.md#shared-runners)
for the entire GitLab instance, or [specific runners](../../ci/runners/runners_scope.md#specific-runners) for the entire GitLab instance, or [specific runners](../../ci/runners/runners_scope.md#specific-runners)
that are assigned to specific projects (the default if you've installed the that are assigned to specific projects.
GitLab Runner managed application).
- **Prometheus** (for [Auto Monitoring](stages.md#auto-monitoring)) - **Prometheus** (for [Auto Monitoring](stages.md#auto-monitoring))
......
This diff is collapsed.
...@@ -6,7 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w ...@@ -6,7 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Crossplane configuration **(FREE)** # Crossplane configuration **(FREE)**
After [installing](applications.md#crossplane) Crossplane, you must configure it for use. After [installing](applications.md#install-crossplane-using-gitlab-cicd) Crossplane, you must configure it for use.
The process of configuring Crossplane includes: The process of configuring Crossplane includes:
1. [Configure RBAC permissions](#configure-rbac-permissions). 1. [Configure RBAC permissions](#configure-rbac-permissions).
......
...@@ -54,10 +54,8 @@ it up using [Helm](https://helm.sh/) as follows: ...@@ -54,10 +54,8 @@ it up using [Helm](https://helm.sh/) as follows:
kubectl create ns gitlab-managed-apps kubectl create ns gitlab-managed-apps
# Download Helm chart values that is compatible with the requirements above. # 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 # These are included in the Cluster Management project template.
# - https://gitlab.com/gitlab-org/gitlab/-/raw/<tag>/vendor/prometheus/values.yaml wget https://gitlab.com/gitlab-org/project-templates/cluster-management/-/raw/master/applications/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 # Add the Prometheus community Helm chart repository
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
...@@ -114,10 +112,8 @@ running: ...@@ -114,10 +112,8 @@ running:
kubectl create namespace gitlab-managed-apps kubectl create namespace gitlab-managed-apps
# Download Helm chart values that is compatible with the requirements above. # 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 # These are included in the Cluster Management project template.
# - https://gitlab.com/gitlab-org/gitlab/-/raw/<tag>/vendor/elastic_stack/values.yaml wget https://gitlab.com/gitlab-org/project-templates/cluster-management/-/raw/master/applications/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 # Add the GitLab Helm chart repository
helm repo add gitlab https://charts.gitlab.io helm repo add gitlab https://charts.gitlab.io
......
...@@ -9,7 +9,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w ...@@ -9,7 +9,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/4752) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 11.0. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/4752) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 11.0.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26383) to [GitLab Free](https://about.gitlab.com/pricing/) 12.9. > - [Moved](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26383) to [GitLab Free](https://about.gitlab.com/pricing/) 12.9.
GitLab makes it easy to view the logs of running pods or managed applications in GitLab makes it easy to view the logs of running pods in
[connected Kubernetes clusters](index.md). By displaying the logs directly in GitLab [connected Kubernetes clusters](index.md). By displaying the logs directly in GitLab
in the **Log Explorer**, developers can avoid managing console tools or jumping in the **Log Explorer**, developers can avoid managing console tools or jumping
to a different interface. The **Log Explorer** interface provides a set of filters to a different interface. The **Log Explorer** interface provides a set of filters
...@@ -18,10 +18,11 @@ above the log file data, depending on your configuration: ...@@ -18,10 +18,11 @@ above the log file data, depending on your configuration:
![Pod logs](img/kubernetes_pod_logs_v12_10.png) ![Pod logs](img/kubernetes_pod_logs_v12_10.png)
- **Namespace** - Select the environment to display. Users with Maintainer or - **Namespace** - Select the environment to display. Users with Maintainer or
greater [permissions](../../permissions.md) can also select Managed Apps. greater [permissions](../../permissions.md) can also see pods in the
- **Search** - Only available if the Elastic Stack managed application is installed. `gitlab-managed-apps` namespace.
- **Select time range** - Select the range of time to display. Only available if the - **Search** - Only available if the [Elastic Stack integration](../../clusters/integrations.md#elastic-stack-cluster-integration) is enabled.
Elastic Stack managed application is installed. - **Select time range** - Select the range of time to display.
Only available if the [Elastic Stack integration](../../clusters/integrations.md#elastic-stack-cluster-integration) is enabled.
- **Scroll to bottom** **{scroll_down}** - Scroll to the end of the displayed logs. - **Scroll to bottom** **{scroll_down}** - Scroll to the end of the displayed logs.
- **Refresh** **{retry}** - Reload the displayed logs. - **Refresh** **{retry}** - Reload the displayed logs.
......
...@@ -20,7 +20,6 @@ The following steps are recommended to install and use Container Host Security t ...@@ -20,7 +20,6 @@ The following steps are recommended to install and use Container Host Security t
1. Install and configure an Ingress node: 1. Install and configure an Ingress node:
- [Install the Ingress node via CI/CD (Cluster Management Project)](../../../../clusters/applications.md#install-ingress-using-gitlab-cicd). - [Install the Ingress node via CI/CD (Cluster Management Project)](../../../../clusters/applications.md#install-ingress-using-gitlab-cicd).
- [Determine the external endpoint via the manual method](../../../../clusters/applications.md#determining-the-external-endpoint-manually).
- Navigate to the Kubernetes page and enter the [DNS address for the external endpoint](../../index.md#base-domain) - Navigate to the Kubernetes page and enter the [DNS address for the external endpoint](../../index.md#base-domain)
into the **Base domain** field on the **Details** tab. Save the changes to the Kubernetes into the **Base domain** field on the **Details** tab. Save the changes to the Kubernetes
cluster. cluster.
......
...@@ -20,7 +20,6 @@ The following steps are recommended to install and use Container Network Securit ...@@ -20,7 +20,6 @@ The following steps are recommended to install and use Container Network Securit
1. Install and configure an Ingress node: 1. Install and configure an Ingress node:
- [Install the Ingress node via CI/CD (Cluster Management Project)](../../../../clusters/applications.md#install-ingress-using-gitlab-cicd). - [Install the Ingress node via CI/CD (Cluster Management Project)](../../../../clusters/applications.md#install-ingress-using-gitlab-cicd).
- [Determine the external endpoint via the manual method](../../../../clusters/applications.md#determining-the-external-endpoint-manually).
- Navigate to the Kubernetes page and enter the [DNS address for the external endpoint](../../index.md#base-domain) - Navigate to the Kubernetes page and enter the [DNS address for the external endpoint](../../index.md#base-domain)
into the **Base domain** field on the **Details** tab. Save the changes to the Kubernetes into the **Base domain** field on the **Details** tab. Save the changes to the Kubernetes
cluster. cluster.
......
...@@ -17,7 +17,7 @@ in the GitLab interface. ...@@ -17,7 +17,7 @@ in the GitLab interface.
There are two ways to set up Prometheus integration, depending on where your apps are running: There are two ways to set up Prometheus integration, depending on where your apps are running:
- For deployments on Kubernetes, GitLab can automatically [deploy and manage Prometheus](#managed-prometheus-on-kubernetes). - For deployments on Kubernetes, GitLab can be [integrated with an in-cluster Prometheus](#prometheus-cluster-integration)
- For other deployment targets, [specify the Prometheus server](#manual-configuration-of-prometheus). - For other deployment targets, [specify the Prometheus server](#manual-configuration-of-prometheus).
Once enabled, GitLab detects metrics from known services in the Once enabled, GitLab detects metrics from known services in the
...@@ -27,137 +27,13 @@ Once enabled, GitLab detects metrics from known services in the ...@@ -27,137 +27,13 @@ Once enabled, GitLab detects metrics from known services in the
## Enabling Prometheus Integration ## Enabling Prometheus Integration
### Managed Prometheus on Kubernetes ### Prometheus cluster integration
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/28916) in GitLab 10.5. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55244) in GitLab 13.11.
> - [Replaced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62725) the Prometheus cluster applications in GitLab 14.0.
**Deprecated:** Managed Prometheus on Kubernetes is deprecated, and GitLab can query an in-cluster Prometheus for your metrics.
scheduled for removal in [GitLab See [Prometheus cluster integration](../../clusters/integrations.md#prometheus-cluster-integration) for details.
14.0](https://gitlab.com/groups/gitlab-org/-/epics/4280).
GitLab can seamlessly deploy and manage Prometheus on a
[connected Kubernetes cluster](../clusters/index.md), to help you monitor your apps.
#### Requirements
- A [connected Kubernetes cluster](../clusters/index.md)
#### Getting started
After you have a connected Kubernetes cluster, you can deploy a managed Prometheus with a single click.
1. Go to the **Operations > Kubernetes** page to view your connected clusters
1. Select the cluster you would like to deploy Prometheus to
1. Click the **Install** button to deploy Prometheus to the cluster
![Managed Prometheus Deploy](img/prometheus_deploy.png)
#### About managed Prometheus deployments
Prometheus is deployed into the `gitlab-managed-apps` namespace, using the
[official Helm chart](https://github.com/helm/charts/tree/master/stable/prometheus).
Prometheus is only accessible in the cluster, with GitLab communicating through the
[Kubernetes API](https://kubernetes.io/docs/concepts/overview/kubernetes-api/).
The Prometheus server
[automatically detects and monitors](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config)
nodes, pods, and endpoints. To configure a resource to be monitored by Prometheus,
set the following [Kubernetes annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/):
- `prometheus.io/scrape` to `true` to enable monitoring of the resource.
- `prometheus.io/port` to define the port of the metrics endpoint.
- `prometheus.io/path` to define the path of the metrics endpoint. Defaults to `/metrics`.
CPU and Memory consumption is monitored, but requires
[naming conventions](prometheus_library/kubernetes.md#specifying-the-environment)
to determine the environment. If you are using
[Auto DevOps](../../../topics/autodevops/index.md), this is handled automatically.
##### Example of Kubernetes service annotations and labels
As an example, to activate Prometheus monitoring of a service:
1. Add at least this annotation: `prometheus.io/scrape: 'true'`.
1. Add two labels so GitLab can retrieve metrics dynamically for any environment:
- `application: ${CI_ENVIRONMENT_SLUG}`
- `release: ${CI_ENVIRONMENT_SLUG}`
1. Create a dynamic PromQL query. For example, a query like
`temperature{application="{{ci_environment_slug}}",release="{{ci_environment_slug}}"}` to either:
- Add [custom metrics](../../../operations/metrics/index.md#adding-custom-metrics).
- Add [custom dashboards](../../../operations/metrics/dashboards/index.md).
The following is a service definition to accomplish this:
```yaml
---
# Service
apiVersion: v1
kind: Service
metadata:
name: service-${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}
# === Prometheus annotations ===
annotations:
prometheus.io/scrape: 'true'
labels:
application: ${CI_ENVIRONMENT_SLUG}
release: ${CI_ENVIRONMENT_SLUG}
# === End of Prometheus ===
spec:
selector:
app: ${CI_PROJECT_NAME}
ports:
- port: ${EXPOSED_PORT}
targetPort: ${CONTAINER_PORT}
```
#### Access the UI of a Prometheus managed application in Kubernetes
You can connect directly to Prometheus, and view the Prometheus user interface, when
using a Prometheus managed application in Kubernetes:
1. Find the name of the Prometheus pod in the user interface of your Kubernetes
provider, such as GKE, or by running the following `kubectl` command in your
terminal:
```shell
kubectl get pods -n gitlab-managed-apps | grep 'prometheus-prometheus-server'
```
The command should return a result like the following example, where
`prometheus-prometheus-server-55b4bd64c9-dpc6b` is the name of the Prometheus pod:
```plaintext
gitlab-managed-apps prometheus-prometheus-server-55b4bd64c9-dpc6b 2/2 Running 0 71d
```
1. Run a `kubectl port-forward` command. In the following example, `9090` is the
Prometheus server's listening port:
```shell
kubectl port-forward prometheus-prometheus-server-55b4bd64c9-dpc6b 9090:9090 -n gitlab-managed-apps
```
The `port-forward` command forwards all requests sent to your system's `9090` port
to the `9090` port of the Prometheus pod. If the `9090` port on your system is used
by another application, you can change the port number before the colon to your
desired port. For example, to forward port `8080` of your local system, change the
command to:
```shell
kubectl port-forward prometheus-prometheus-server-55b4bd64c9-dpc6b 8080:9090 -n gitlab-managed-apps
```
1. Open `localhost:9090` in your browser to display the Prometheus user interface.
#### Script access to Prometheus
You can script the access to Prometheus, extracting the name of the pod automatically like this:
```shell
POD_INFORMATION=$(kubectl get pods -n gitlab-managed-apps | grep 'prometheus-prometheus-server')
POD_NAME=$(echo $POD_INFORMATION | awk '{print $1;}')
kubectl port-forward $POD_NAME 9090:9090 -n gitlab-managed-apps
```
### Manual configuration of Prometheus ### Manual configuration of Prometheus
...@@ -219,12 +95,12 @@ to integrate with. ...@@ -219,12 +95,12 @@ to integrate with.
### Precedence with multiple Prometheus configurations ### Precedence with multiple Prometheus configurations
Although you can enable both a [manual configuration](#manual-configuration-of-prometheus) Although you can enable both a [manual configuration](#manual-configuration-of-prometheus)
and [auto configuration](#managed-prometheus-on-kubernetes) of Prometheus, you and [cluster integration](#prometheus-cluster-integration) of Prometheus, you
can use only one: can use only one:
- If you have enabled a - If you have enabled a
[Prometheus manual configuration](#manual-configuration-of-prometheus) [Prometheus manual configuration](#manual-configuration-of-prometheus)
and a [managed Prometheus on Kubernetes](#managed-prometheus-on-kubernetes), and a [Prometheus cluster integration](#prometheus-cluster-integration),
the manual configuration takes precedence and is used to run queries from the manual configuration takes precedence and is used to run queries from
[custom dashboards](../../../operations/metrics/dashboards/index.md) and [custom dashboards](../../../operations/metrics/dashboards/index.md) and
[custom metrics](../../../operations/metrics/index.md#adding-custom-metrics). [custom metrics](../../../operations/metrics/index.md#adding-custom-metrics).
......
...@@ -33,7 +33,7 @@ integration services must be enabled. ...@@ -33,7 +33,7 @@ integration services must be enabled.
Prometheus needs to be deployed into the cluster and configured properly in order to gather Kubernetes metrics. GitLab supports two methods for doing so: Prometheus needs to be deployed into the cluster and configured properly in order to gather Kubernetes metrics. GitLab supports two methods for doing so:
- GitLab [integrates with Kubernetes](../../clusters/index.md), and can [deploy Prometheus into a connected cluster](../prometheus.md#managed-prometheus-on-kubernetes). It is automatically configured to collect Kubernetes metrics. - GitLab [integrates with Kubernetes](../../clusters/index.md), and can [query a Prometheus in a connected cluster](../../../clusters/integrations.md#prometheus-cluster-integration). The in-cluster Prometheus can be configured to automatically collect application metrics from your cluster.
- To configure your own Prometheus server, you can follow the [Prometheus documentation](https://prometheus.io/docs/introduction/overview/). - To configure your own Prometheus server, you can follow the [Prometheus documentation](https://prometheus.io/docs/introduction/overview/).
## Specifying the Environment ## Specifying the Environment
......
...@@ -6901,13 +6901,13 @@ msgstr "" ...@@ -6901,13 +6901,13 @@ msgstr ""
msgid "ClusterAgent|You have insufficient permissions to delete this cluster agent" msgid "ClusterAgent|You have insufficient permissions to delete this cluster agent"
msgstr "" msgstr ""
msgid "ClusterIntegration|%{appList} was successfully installed on your Kubernetes cluster" msgid "ClusterApplicationsRemoved|One-click application management was removed in GitLab 14.0. Your applications are still installed in your cluster, and integrations continue working."
msgstr "" msgstr ""
msgid "ClusterIntegration|%{boldStart}Note:%{boldEnd} Requires Ingress to be installed." msgid "ClusterIntegration|%{appList} was successfully installed on your Kubernetes cluster"
msgstr "" msgstr ""
msgid "ClusterIntegration|%{externalIp}.nip.io" msgid "ClusterIntegration|%{boldStart}Note:%{boldEnd} Requires Ingress to be installed."
msgstr "" msgstr ""
msgid "ClusterIntegration|%{linkStart}More information%{linkEnd}" msgid "ClusterIntegration|%{linkStart}More information%{linkEnd}"
...@@ -6973,9 +6973,6 @@ msgstr "" ...@@ -6973,9 +6973,6 @@ msgstr ""
msgid "ClusterIntegration|Allows GitLab to query a specifically configured in-cluster Prometheus for metrics." msgid "ClusterIntegration|Allows GitLab to query a specifically configured in-cluster Prometheus for metrics."
msgstr "" msgstr ""
msgid "ClusterIntegration|Alternatively, "
msgstr ""
msgid "ClusterIntegration|Amazon EKS" msgid "ClusterIntegration|Amazon EKS"
msgstr "" msgstr ""
...@@ -7861,9 +7858,6 @@ msgstr "" ...@@ -7861,9 +7858,6 @@ msgstr ""
msgid "ClusterIntegration|access to Google Kubernetes Engine" msgid "ClusterIntegration|access to Google Kubernetes Engine"
msgstr "" msgstr ""
msgid "ClusterIntegration|can be used instead of a custom domain. "
msgstr ""
msgid "ClusterIntegration|installed via %{linkStart}Cloud Run%{linkEnd}" msgid "ClusterIntegration|installed via %{linkStart}Cloud Run%{linkEnd}"
msgstr "" msgstr ""
......
# frozen_string_literal: true
require 'spec_helper'
require_relative '../../../../spec/features/clusters/installing_applications_shared_examples'
RSpec.describe 'Instance-level Cluster Applications', :js do
include GoogleApi::CloudPlatformHelpers
let(:user) { create(:admin) }
before do
sign_in(user)
gitlab_enable_admin_mode_sign_in(user)
end
describe 'Installing applications' do
include_examples "installing applications on a cluster" do
let(:cluster_path) { admin_cluster_path(cluster) }
let(:cluster_factory_args) { [:instance] }
end
end
end
...@@ -31,30 +31,6 @@ RSpec.describe 'Clusterable > Show page' do ...@@ -31,30 +31,6 @@ RSpec.describe 'Clusterable > Show page' do
expect(page).to have_content('Kubernetes cluster was successfully updated.') expect(page).to have_content('Kubernetes cluster was successfully updated.')
end end
context 'when there is a cluster with ingress and external ip', :js do
before do
cluster.create_application_ingress!(external_ip: '192.168.1.100')
visit cluster_path
end
it 'shows help text with the domain as an alternative to custom domain', :js do
within '.js-cluster-details-form' do
expect(find(cluster_ingress_help_text_selector).text).to include('192.168.1.100')
end
end
end
context 'when there is no ingress' do
it 'alternative to custom domain is not shown' do
visit cluster_path
within '.js-cluster-details-form' do
expect(page).not_to have_selector(cluster_ingress_help_text_selector)
end
end
end
it 'does not show the environments tab' do it 'does not show the environments tab' do
visit cluster_path visit cluster_path
......
...@@ -27,8 +27,8 @@ RSpec.describe 'Cluster Health board', :js, :kubeclient, :use_clean_rails_memory ...@@ -27,8 +27,8 @@ RSpec.describe 'Cluster Health board', :js, :kubeclient, :use_clean_rails_memory
expect(page).to have_css('.cluster-health-graphs') expect(page).to have_css('.cluster-health-graphs')
end end
context 'no prometheus enabled' do context 'no prometheus available' do
it 'shows install prometheus message' do it 'shows enable Prometheus message' do
visit cluster_path visit cluster_path
click_link 'Health' click_link 'Health'
...@@ -82,12 +82,12 @@ RSpec.describe 'Cluster Health board', :js, :kubeclient, :use_clean_rails_memory ...@@ -82,12 +82,12 @@ RSpec.describe 'Cluster Health board', :js, :kubeclient, :use_clean_rails_memory
def stub_empty_response def stub_empty_response
stub_prometheus_request(/prometheus-prometheus-server/, status: 204, body: {}) stub_prometheus_request(/prometheus-prometheus-server/, status: 204, body: {})
stub_prometheus_request(/prometheus\/api\/v1/, status: 204, body: {}) stub_prometheus_request(%r{prometheus/api/v1}, status: 204, body: {})
end end
def stub_connected def stub_connected
stub_prometheus_request(/prometheus-prometheus-server/, body: prometheus_values_body) stub_prometheus_request(/prometheus-prometheus-server/, body: prometheus_values_body)
stub_prometheus_request(/prometheus\/api\/v1/, body: prometheus_values_body) stub_prometheus_request(%r{prometheus/api/v1}, body: prometheus_values_body)
end end
end end
end end
# frozen_string_literal: true
require 'spec_helper'
require_relative '../../../../spec/features/clusters/installing_applications_shared_examples'
RSpec.describe 'Group-level Cluster Applications', :js do
include GoogleApi::CloudPlatformHelpers
let(:group) { create(:group) }
let(:user) { create(:user) }
before do
group.add_maintainer(user)
sign_in(user)
end
describe 'Installing applications' do
include_examples "installing applications on a cluster" do
let(:cluster_path) { group_cluster_path(group, cluster) }
let(:cluster_factory_args) { [:group, groups: [group]] }
end
end
end
# frozen_string_literal: true
require 'spec_helper'
require_relative '../../../../spec/features/clusters/installing_applications_shared_examples'
RSpec.describe 'Project-level Cluster Applications', :js do
include GoogleApi::CloudPlatformHelpers
let(:project) { create(:project) }
let(:user) { create(:user) }
before do
project.add_maintainer(user)
sign_in(user)
end
describe 'Installing applications' do
include_examples "installing applications on a cluster" do
let(:cluster_path) { project_cluster_path(project, cluster) }
let(:cluster_factory_args) { [projects: [project]] }
end
end
end
...@@ -15,7 +15,6 @@ describe('ClusterIntegrationForm', () => { ...@@ -15,7 +15,6 @@ describe('ClusterIntegrationForm', () => {
editable: true, editable: true,
environmentScope: '*', environmentScope: '*',
baseDomain: 'testDomain', baseDomain: 'testDomain',
applicationIngressExternalIp: null,
}; };
const createWrapper = (storeValues = defaultStoreValues) => { const createWrapper = (storeValues = defaultStoreValues) => {
...@@ -72,18 +71,6 @@ describe('ClusterIntegrationForm', () => { ...@@ -72,18 +71,6 @@ describe('ClusterIntegrationForm', () => {
expect(findSubmitButton().exists()).toBe(false); expect(findSubmitButton().exists()).toBe(false);
}); });
}); });
it('does not render external IP block if applicationIngressExternalIp was not passed', () => {
createWrapper({ ...defaultStoreValues });
expect(wrapper.find('.js-ingress-domain-help-text').exists()).toBe(false);
});
it('renders external IP block if applicationIngressExternalIp was passed', () => {
createWrapper({ ...defaultStoreValues, applicationIngressExternalIp: '127.0.0.1' });
expect(wrapper.find('.js-ingress-domain-help-text').exists()).toBe(true);
});
}); });
describe('reactivity', () => { describe('reactivity', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment