Nginx入口控制器未给出普罗米修斯的度量标准

问题描述 投票:0回答:1

我正在尝试部署一个可以使用prometheus进行监视的nginx入口控制器,但是我遇到了一个问题,似乎没有像我在网上找到的大多数帖子和文档一样创建任何指标pod。

我正在使用掌舵来部署入口控制器,并使用CLI争论来启用指标。

helm install ingress stable/nginx-ingress --set controller.metrics.enabled=true

这是我的入口文件

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    # add an annotation indicating the issuer to use.
    kubernetes.io/ingress.class: "nginx"
    cert-manager.io/cluster-issuer: "letsencrypt-dev"
    # needed to allow the front end to talk to the back end
    nginx.ingress.kubernetes.io/cors-allow-origin: "https://app.domain.com"
    nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
    nginx.ingress.kubernetes.io/enable-cors: "true"
    nginx.ingress.kubernetes.io/cors-allow-methods: "GET, PUT, POST, DELETE, PATCH, OPTIONS"
    # needed for monitoring
    prometheus.io/scrape: "true"
    prometheus.io/port: "10254"
  name: dev-ingress
  namespace: development
spec:
  rules:
  - host: api.<domain>.com
    http:
      paths:
      - backend:
          serviceName: api
          servicePort: 8090
        path: /
  tls: # < placing a host in the TLS config will indicate a certificate should be created
  - hosts:
    - api.<domai>.com
    secretName: dev-ingress-cert # < cert-manager will store the created certificate in this secre

如果这有所作为,我将通过以下命令使用prometheus运算符舵图。

helm install monitoring stable/prometheus-operator --namespace=monitoring

所有名称空间已经存在,所以应该不成问题,因为我在很多地方看到的开发与监视名称空间都是可以接受的,因此我着手进行处理,以使事情更容易确定正在发生的情况。

nginx kubernetes kubernetes-helm nginx-ingress prometheus-operator
1个回答
0
投票
我将遵循此guide来设置对Nginx入口控制器的监视。我相信您所缺少的是prometheus.yaml,它为Nginx入口控制器定义了scrape config,为Prometheus定义了RBAC,以便能够对Nginx入口控制器指标进行刮擦。
© www.soinside.com 2019 - 2024. All rights reserved.