kubernetes - Grafana 仪表板不适用于 Ingress
问题描述
我已安装在 kube-prometheus-stack 下方,并在尝试使用其自己的 Ingress URL 访问 Grafana 仪表板时出错。我相信我在这里遗漏了一些愚蠢的东西,但找不到任何线索。我在这里和其他人也看过类似的帖子。
图表:kube-prometheus-stack-9.4.5 应用版本:0.38.1
当我导航到https://myorg.grafanatest.com URL 时,我被重定向到https://myorg.grafanatest.com/login并显示以下消息。
对 grafana/values.yaml 所做的更改:
grafana.ini:
server:
# The full public facing url you use in browser, used for redirects and emails
root_url: https://myorg.grafanatest.com
进行上述更改后,用于安装 Prometheus-Grafana 运算符的 Helm 命令。
helm install pg kube-prometheus-stack/ -n monitoring
我在 Grafana pod 内的 grafana.ini 文件中看到以下设置。
[analytics]
check_for_updates = true
[grafana_net]
url = https://grafana.net
[log]
mode = console
[paths]
data = /var/lib/grafana/data
logs = /var/log/grafana
plugins = /var/lib/grafana/plugins
provisioning = /etc/grafana/provisioning
[server]
root_url = https://myorg.grafanatest.com/
解决方案
您需要从父图表 values.yaml 进行编辑
- 从 kube-prometheus-stack 图表中获取默认 values.yaml,保存到文件
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm repo update
helm show values prometheus-community/kube-prometheus-stack > values.yaml
在 values.yaml 文件中,像这样编辑:
## Using default values from https://github.com/grafana/helm-charts/blob/main/charts/grafana/values.yaml
##
#### This below line is in 509 line
grafana:
enabled: true
namespaceOverride: ""
## Deploy default dashboards.
##
defaultDashboardsEnabled: true
adminPassword: prom-operator
ingress:
## If true, Grafana Ingress will be created
##
enabled: true
## Annotations for Grafana Ingress
##
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
## Labels to be added to the Ingress
##
labels: {}
## Hostnames.
## Must be provided if Ingress is enable.
##
# hosts:
# - grafana.domain.com
hosts:
- myorg.grafanatest.com
## Path for grafana ingress
path: /
grafana.ingress.enabled
到true
grafana.ingress.hosts
添加- myorg.grafanatest.com
- 应用它
helm -n monitoring install -f ./values.yaml kube-prometheus prometheus-community/kube-prometheus-stack
希望能帮到你
推荐阅读
- python - 如何在scrapy Sitemap蜘蛛中覆盖sitemap_rules?
- mysql - MySQL 1366 不正确的整数值
- go - 如何在 Go 中正确打开进程并记录标准输入和标准输出?
- python - Sqlalchemy + Postgres - 多个值更新
- spring-boot - 如何每分钟从队列接收消息一次春季启动?
- android - 读取 USB OTG 文件返回 null
- sql - 在 postgres 中获取 JSON 字段的键
- wget - Gerrit 代码审查 - 如何使用 wget 使用 http 密码下载文件?
- matlab - 3D 曲面图 MATLAB
- r - 将 2 列中的所有唯一值收集到一个新列中