amazon-web-services - 无法通过 Kubernetes 的 AWS ELB 访问 Grafana(用于 prometheus)
问题描述
我们有一个由几个节点组成的集群,所以我不能做一个 NodePort,而只是去我的 node-ip(这是我为测试普罗米修斯所做的)。我在“监控”命名空间中做了一个 helm install stable/prometheus 和 stable/grafana。
到目前为止一切看起来都还不错。
然后,我尝试创建一个访问 Grafana 的 LB 服务,该服务已创建,我可以看到 CNAME 指向 AWS 上 ELB 的 A 记录,但是在访问 Grafana 的 URL 时,什么也没发生,没有 HTTP 错误,没有问题的页面,什么都没有。
这是service-elb.yaml
:
apiVersion: v1
kind: Service
metadata:
name: grafana-lb
namespace: monitoring
labels:
app: grafana
annotations:
dns.alpha.kubernetes.io/external: grafana-testing.country.ourdomain
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:xxxxxx
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: '443'
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600'
spec:
selector:
app: grafana
tier: frontend
type: LoadBalancer
ports:
- name: https
port: 443
targetPort: 80
- name: http
port: 80
targetPort: 3000
loadBalancerSourceRanges:
- somerange
- someotherrange
- etc etc
顺便说一句,如果我不使用 --set rbac.create=false 创建图表,则会出现有关服务帐户的权限错误
我最近为 Kibana 使用了 nginx-proxy-pass,并且还使用了类似的 LB 服务,没有问题。但是我在这里遗漏了一些东西,现在还找不到它是什么。
任何帮助都感激不尽。如果我让它工作,我会更新。
解决方案
解决了,必须删除“层”选择器,只使用这样的规范:
spec:
selector:
app: grafana
type: LoadBalancer
ports:
- name: http
port: 3000
推荐阅读
- sql - SQL - 仅使用一种特定类型查找内部联接
- python-3.x - 自动打印现有的 MS Access 报告(最好使用 Python,但对替代方案开放)
- objective-c - 在私有 pod 中使用模块化标头、Objective-C 和 Swift 时,应用程序中的类别定义重复
- bash - 在 CMD 中使用 WSL(Linux 的 Windows 子系统)bash 命令
- python - Django Login/Signup With own users 模型
- java - 如何计算使用 Hibernate 对 H2 数据库进行的 SQL 查询的数量
- angularjs - Angular HTML Autocomplete="nope" 或 "off" 无法在 Chrome 中从 CDN 托管
- android - 如何将字符串值从编辑文本传递到同一片段中的按钮
- json - 使用 Jmeter 验证 JSON 响应密钥
- lua - Lua以某种方式计算表中的总值