0 基本上你按这个官方文档走就可以了。
https://kubernetes.github.io/ingress-nginx/user-guide/monitoring/
我这边不用helm的方式。
1. 创建service
apiVersion: v1
kind: Service
metadata:
labels:
app: nginx-ingress
name: prom-nginx
namespace: kube-system
spec:
ports:
- name: prom
port: 10254
protocol: TCP
targetPort: 10254
selector:
app: nginx-ingress
type: ClusterIP
2. 创建serviceMonitor
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: nginx-ingress
namespace: kube-system
spec:
endpoints:
- interval: 15s
port: prom
selector:
matchLabels:
app: nginx-ingress
到prometheus里面验证一下通不通。
3. grafana导入dashboard
挑一个人数最多的,9614 ,就你了.
end
还是比较简单的。个人后期将focus在云原生领域,太多了搞不过来。
标签:ingress,name,app,prom,nginx,prometheus From: https://www.cnblogs.com/gqdw/p/17538424.html