doc/ci/environments/kubernetes_dashboard.md
{{< details >}}
{{< /details >}}
{{< history >}}
environment_settings_to_graphql, kas_user_access, kas_user_access_project, and expose_authorized_cluster_agents. This feature is in beta.environment_settings_to_graphql removed in GitLab 16.2.kas_user_access, kas_user_access_project, and expose_authorized_cluster_agents removed in GitLab 16.2.{{< /history >}}
Use the dashboard for Kubernetes to understand the status of your clusters with an intuitive visual interface. The dashboard works with every connected Kubernetes cluster, whether you deployed them with CI/CD or GitOps.
{{< history >}}
kubernetes_namespace_for_environment. Disabled by default.kubernetes_namespace_for_environment removed.flux_resource_for_environment.flux_resource_for_environment removed.{{< /history >}}
Configure a dashboard to use it for a given environment. You can configure dashboard for an environment that already exists, or add one when you create an environment.
Prerequisites:
user_access is configured for the environment's project or its parent group.{{< tabs >}}
{{< tab title="The environment already exists" >}}
{{< /tab >}}
{{< tab title="The environment doesn't exist" >}}
{{< /tab >}}
{{< /tabs >}}
{{< history >}}
{{< /history >}}
To configure a dashboard for a dynamic environment:
.gitlab-ci.yml file. You must specify the full path to the agent configuration project,
followed by a colon and the name of the agent.For example:
deploy_review_app:
stage: deploy
script: make deploy
environment:
name: review/$CI_COMMIT_REF_SLUG
kubernetes:
agent: path/to/agent/project:agent-name
For more information, see the CI/CD YAML syntax reference.
{{< history >}}
k8s_watch_api. Disabled by default.k8s_watch_api removed.{{< /history >}}
View a dashboard to see the status of connected clusters. The status of your Kubernetes resources and Flux reconciliation updates in real time.
To view a configured dashboard:
A list of pods is displayed. Select a pod to view its details.
{{< history >}}
flux_resource_for_environment.flux_resource_for_environment removed.{{< /history >}}
You can review the sync status of your Flux deployments from a dashboard.
To display the deployment status, your dashboard must be able to retrieve the Kustomization and HelmRelease resources,
which requires a namespace to be configured for the environment.
GitLab searches the Kustomization and HelmRelease resources specified by the Flux resource dropdown list in the environment settings.
A dashboard displays one of the following status badges:
| Status | Description |
|---|---|
| Reconciled | The deployment successfully reconciled with its environment. |
| Reconciling | A reconciliation is in progress. |
| Stalled | A reconciliation is stuck because of an error that cannot be resolved without human intervention. |
| Failed | The deployment couldn't reconcile because of an unrecoverable error. |
| Unknown | The sync status of the deployment couldn't be retrieved. |
| Unavailable | The Kustomization or HelmRelease resource couldn't be retrieved. |
{{< history >}}
{{< /history >}}
You can manually reconcile your deployment with its Flux resources.
To trigger a reconciliation:
{{< history >}}
{{< /history >}}
You can manually suspend or resume your Flux reconciliation from the UI.
To suspend or resume reconciliation:
{{< history >}}
{{< /history >}}
View pod logs when you want to quickly understand and troubleshoot issues across your environments from a configured dashboard. You can view logs for each container in a pod.
You can also view pod logs from the pod details.
{{< history >}}
{{< /history >}}
To restart a failed pod, delete it from the Kubernetes dashboard.
To delete a pod:
You can also delete a pod from the pod details.
{{< history >}}
k8s_dashboard. Disabled by default.{{< /history >}}
[!flag] The availability of this feature is controlled by a feature flag. For more information, see the history. This feature is available for testing, but not ready for production use.
The detailed dashboard provides information about the following Kubernetes resources:
Each dashboard displays a list of resources with their statuses, namespaces, and age. You can select a resource to open a drawer with more information, including labels and YAML-formatted status, annotations, and spec.
Because of the focus shift described in this issue, work on the detailed dashboard is paused.
To provide feedback on the detailed dashboard, see issue 460279.
Prerequisites:
user_access keyword.The detailed dashboard is not linked from the sidebar navigation. To view a detailed dashboard:
Find your agent for Kubernetes ID:
Go to one of the following URLs, replacing <agent_id> with your agent ID:
| Resource type | URL |
|---|---|
| Pods | https://myinstance.gitlab.com/-/kubernetes/<agent_id>/pods |
| Services | https://myinstance.gitlab.com/-/kubernetes/<agent_id>/services |
| Deployments | https://myinstance.gitlab.com/-/kubernetes/<agent_id>/deployments |
| ReplicaSets | https://myinstance.gitlab.com/-/kubernetes/<agent_id>/replicaSets |
| StatefulSets | https://myinstance.gitlab.com/-/kubernetes/<agent_id>/statefulSets |
| DaemonSets | https://myinstance.gitlab.com/-/kubernetes/<agent_id>/daemonSets |
| Jobs | https://myinstance.gitlab.com/-/kubernetes/<agent_id>/jobs |
| CronJobs | https://myinstance.gitlab.com/-/kubernetes/<agent_id>/cronJobs |
When working with the dashboard for Kubernetes, you might encounter the following issues.
You might get an error that states Error: services is forbidden: User "gitlab:user:<user-name>" cannot list resource "<resource-name>" in API group "" at the cluster scope.
This error happens when a user is not allowed to do the specified operation in the Kubernetes RBAC.
To resolve, check your RBAC configuration. If the RBAC is properly configured, contact your Kubernetes administrator.
When you configure a new environment, the GitLab agent dropdown list might be empty, even if you have configured Kubernetes clusters.
To populate the GitLab agent dropdown list, grant an agent Kubernetes access with the user_access keyword.