无法通过 Kubernetes 的 AWS ELB 访问 Grafana(用于普罗米修斯)
Can't access Grafana(for prometheus) via AWS ELB at Kubernetes
我们有一个由多个节点组成的集群,所以我无法执行 NodePort,只能转到我的 node-ip(这是我为测试 prometheus 所做的)。
我在 "monitoring" 命名空间安装了 helm stable/prometheus 和 stable/grafana。
到目前为止一切正常。
然后,我尝试创建一个 LB 服务来访问创建的 Grafana,我可以看到 CNAME 指向 AWS 的 ELB 的 A 记录,但是当访问 URL Grafana,没有任何反应,没有 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
创建图表,则会出现有关 serviceaccount 的权限错误
我最近为 Kibana 使用了 nginx-proxy-pass,也使用了类似的 LB 服务,没有问题。但是我在这里遗漏了一些东西,现在还不知道是什么。
任何帮助将不胜感激。如果我让它工作,我会更新。
已解决,必须删除 "tier" 选择器并使用如下规范:
spec:
selector:
app: grafana
type: LoadBalancer
ports:
- name: http
port: 3000
我们有一个由多个节点组成的集群,所以我无法执行 NodePort,只能转到我的 node-ip(这是我为测试 prometheus 所做的)。 我在 "monitoring" 命名空间安装了 helm stable/prometheus 和 stable/grafana。
到目前为止一切正常。
然后,我尝试创建一个 LB 服务来访问创建的 Grafana,我可以看到 CNAME 指向 AWS 的 ELB 的 A 记录,但是当访问 URL Grafana,没有任何反应,没有 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
创建图表,则会出现有关 serviceaccount 的权限错误我最近为 Kibana 使用了 nginx-proxy-pass,也使用了类似的 LB 服务,没有问题。但是我在这里遗漏了一些东西,现在还不知道是什么。
任何帮助将不胜感激。如果我让它工作,我会更新。
已解决,必须删除 "tier" 选择器并使用如下规范:
spec:
selector:
app: grafana
type: LoadBalancer
ports:
- name: http
port: 3000