> For the complete documentation index, see [llms.txt](https://utm-1.gitbook.io/utm-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://utm-1.gitbook.io/utm-docs/dokumentaciya/utm-it/resheniya/kubernetes/prilozheniya/kubernetes-dashboard.md).

# Kubernetes Dashboard

## Ссылки

Развертывание и доступ к панели мониторинга Kubernetes: [kubernetes.io](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/)

Установка и использование Kubernetes dashboard: [alnotes.ru](https://alnotes.ru/DevOps/kubernetes/dashboard/?ysclid=mhd4ttiu71707792990)

## Установка

### Установка через Argo CD

{% hint style="info" %}
Рекомендованный вариант установки.

Предварительное условие - развернутое в кластере приложение [Argo CD](/utm-docs/dokumentaciya/utm-it/resheniya/kubernetes/prilozheniya/argo-cd.md) для управления кластером.
{% endhint %}

В github в репозитории argocd в каталоге `env-prod\apps` создать подкаталог `k8s-dashboard` в котором создать файл `app.yaml` следующего содержания:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name     : k8s-dashboard
  namespace: argocd
spec:
  project: default
  destination:
    name     : in-cluster
    namespace: k8s-dashboard
  sources:
  - chart: kubernetes-dashboard
    repoURL: https://kubernetes.github.io/dashboard
    targetRevision: 7.14.0
    helm:
      releaseName: kubernetes-dashboard
  - repoURL: git@github.com:utenkov-maxim/argocd.git
    targetRevision: HEAD
    path: "env-prod/apps/k8s-dashboard/manifests"

  syncPolicy:
    automated:
      prune   : true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true
```

В каталоге `k8s-dashboard` создать подкаталог `manifests` в котором создать следующие файлы:

**dashboard-serviceaccount.yaml**

```yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: dashboard-serviceaccount
  namespace: k8s-dashboard
```

**dashboard-serviceaccount-token.yaml**

```yaml
apiVersion: v1
kind: Secret
metadata:
  name: dashboard-serviceaccount-token
  namespace: k8s-dashboard
  annotations:
    kubernetes.io/service-account.name: dashboard-serviceaccount
type: kubernetes.io/service-account-token
```

**dashboard-serviceaccount-clusterrolebinding.yaml**

```yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: dashboard-serviceaccount-clusterrolebinding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: dashboard-serviceaccount
  namespace: k8s-dashboard
```

**dashboard-ingress.yaml**

```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dashboard-ingress
  namespace: k8s-dashboard
  annotations:
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"

spec:
  ingressClassName: nginx
  rules:
  - host: k8s-dashboard.utmsoft.ru
    http:
      paths:
      - pathType: Prefix
        path: /
        backend:
          service:
            name: kubernetes-dashboard-kong-proxy
            port: 
              number: 443
```

Сделать коммит в github. После этого Argo CD развернет Kubernetes Dashboard в связанном кластере Kubernetes.

Токен для доступа к Kubernetes Dashboard можно посмотреть следующей командой:

```bash
kubectl get secret dashboard-serviceaccount-token -n k8s-dashboard -o jsonpath="{.data.token}" | base64 -d
```

### Развертывание пользовательского интерфейса панели мониторинга через helm <a href="#deploying-the-dashboard-ui" id="deploying-the-dashboard-ui"></a>

{% hint style="warning" %}
Не рекомендованный вариант установки
{% endhint %}

Выполните следующую команду:

```shell
# Add kubernetes-dashboard repository
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
# Deploy a Helm Release named "kubernetes-dashboard" using the kubernetes-dashboard chart
helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard
```

<details>

<summary>Результат выполнения команды установки</summary>

```
Release "kubernetes-dashboard" does not exist. Installing it now.
NAME: kubernetes-dashboard
LAST DEPLOYED: Thu Oct 30 10:52:01 2025
NAMESPACE: kubernetes-dashboard
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
*************************************************************************************************
*** PLEASE BE PATIENT: Kubernetes Dashboard may need a few minutes to get up and become ready ***
*************************************************************************************************

Congratulations! You have just installed Kubernetes Dashboard in your cluster.

To access Dashboard run:
  kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443

NOTE: In case port-forward command does not work, make sure that kong service name is correct.
      Check the services in Kubernetes Dashboard namespace using:
        kubectl -n kubernetes-dashboard get svc

Dashboard will be available at:
  https://localhost:8443

```

</details>

### Доступ к пользовательскому интерфейсу панели инструментов <a href="#accessing-the-dashboard-ui" id="accessing-the-dashboard-ui"></a>

Для защиты данных кластера Dashboard по умолчанию разворачивается с минимальной конфигурацией RBAC. В настоящее время Dashboard поддерживает вход только с помощью токена Bearer.

[Инструкция по созданию токена](/utm-docs/dokumentaciya/utm-it/resheniya/kubernetes/nastroika-klastera/sozdanie-servis-akkaunta-dlya-dashboard.md).

[Оригинальная инструкция](https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md).

**Предупреждение:**

Созданный в этом руководстве образец пользователя будет иметь права администратора и предназначен только для образовательных целей.

#### Прокси-сервер командной строки <a href="#command-line-proxy" id="command-line-proxy"></a>

Вы можете включить доступ к панели мониторинга с помощью `kubectl`инструмента командной строки, выполнив следующую команду:

```
kubectl -n k8s-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443
```

Kubectl сделает панель управления доступной по адресу [https://localhost:8443](https://localhost:8443/) .

Доступ к пользовательскому интерфейсу возможен *только* с того компьютера, на котором выполняется команда. `kubectl port-forward --help`Дополнительные параметры см. здесь.

**Примечание:**

Метод аутентификации kubeconfig **не** поддерживает внешних поставщиков удостоверений или аутентификацию на основе сертификатов X.509.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://utm-1.gitbook.io/utm-docs/dokumentaciya/utm-it/resheniya/kubernetes/prilozheniya/kubernetes-dashboard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
