Как стать автором
Поиск
Написать публикацию
Обновить

Комментарии 3

А у вас получилось прикрутить сюда мониторинг от prometheus? Ибо в этой конфигурации штатно не показываются данные по cpu/mem подов и нод.

Лично я не настраивал, мы сразу сливаем во внешний мониторинг, однако можно воспользоваться опытом Вадима Рутковского (статья по переводу окд с прома на victoriametrics).

Можно еще посмотреть на ключи самой консоли:

/opt/bridge/bin/bridge -h
  -thanos-public-url string
        Public URL of the cluster's Thanos server.
  -prometheus-public-url string
        Public URL of the cluster's Prometheus server.

По идее консоль смотрит в метрики именно по url ключа thanos-public-url, смотреть надо в ту сторону.

Еще есть референс от разработчиков RedHat (судя по всему Вадим на эти урлы и опирается):

	// Well-known location of the tenant aware Thanos service for OpenShift exposing the query and query_range endpoints. This is only accessible in-cluster.
	// Thanos proxies requests to both cluster monitoring and user workload monitoring prometheus instances.
	openshiftThanosTenancyHost = "thanos-querier.openshift-monitoring.svc:9092"

	// Well-known location of the tenant aware Thanos service for OpenShift exposing the rules endpoint. This is only accessible in-cluster.
	// Thanos proxies requests to the cluster monitoring and user workload monitoring prometheus instances as well as Thanos ruler instances.
	openshiftThanosTenancyForRulesHost = "thanos-querier.openshift-monitoring.svc:9093"

	// Well-known location of the Thanos service for OpenShift. This is only accessible in-cluster.
	// This is used for non-tenant global query requests
	// proxying to both cluster monitoring and user workload monitoring prometheus instances.
	openshiftThanosHost = "thanos-querier.openshift-monitoring.svc:9091"

Пожалуй отвечу сам, возможно кто-то пойдёт по моему пути и тоже упрётся.

Я решил в какой то мере подключение обычного prometheus к этой консоли.

Вопрос с подключением к prometheus решается опциями в запуске:

            - '--k8s-mode=off-cluster'
            - '--k8s-mode-off-cluster-thanos=http://prometheus-svc.prometheus-namespace:port'
            - '--k8s-mode-off-cluster-alertmanager=http://alertmanager-svc.alertmanager-namespace:port'
            - '--k8s-mode-off-cluster-endpoint=https://kubernetes.default:443'
            - '--k8s-mode-off-cluster-skip-verify-tls=true'

Дальше придётся подключать кастомные метрики относительно ванильной инсталляции стека kube-prometheus-stack

Статья в помощь: https://engineering.cloudflight.io/running-the-openshift-console-in-plain-kubernetes

Метрики для создания, которые используются в openshift:

https://github.com/openshift/cluster-monitoring-operator/blob/master/assets/cluster-monitoring-operator/prometheus-rule.yaml

Придётся подгонять под себя, патчить (в моём случае некоторые метрики отдавали по метке 'instance' ip ноды вместо имени, а в коде используется имя ноды). Некоторых метрик нет в куберовском мониторинге, придётся что то выдумывать.

Также потребуется патчинг файлов (это как минимум):

https://github.com/openshift/console/blob/master/frontend/packages/console-app/src/components/nodes/NodesPage.tsx

https://github.com/openshift/console/blob/master/frontend/packages/console-app/src/components/nodes/node-dashboard/queries.ts

Патчим разделы с запросами, попутно проверяем что запросы отдают нормальные данные на вашем prometheus.

Дальше собираем фронт через:

git clone https://github.com/openshift/console
cd console/frontend
yarn install
yarn run build

И подсовываем в кастомный образ console например так (Dockerfile):

FROM quay.io/openshift/origin-console:4.16
COPY ./dist /opt/bridge/static
WORKDIR /
USER 1001
CMD [ "/opt/bridge/bin/bridge", "--public-dir=/opt/bridge/static" ]

В моём случае мониторинг (его значительная часть) заработал. Но не отрабатывает проваливание в подробности метрики по нажатию на любой из графиков мониторинга, показывает пустую страницу. Если кто-то сумел это победить - прошу подсказать решение.

Зарегистрируйтесь на Хабре, чтобы оставить комментарий

Публикации