首页 > 其他分享 >kube-prometheus监控k8s组件

kube-prometheus监控k8s组件

时间:2022-11-24 14:57:53浏览次数:41  
标签:kube ntmaorong grafana prometheus alertmanager k8s com

  • 下载
git clone -b release-0.7 https://github.com/prometheus-operator/kube-prometheus.git
  • 安装
cd kube-prometheus/manifests
kubectl create -f setup/
kubectl create -f .
  • 配置ingress
vi prometheus-ingress.yaml 
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: prometheus-grafana-alertmanager
  namespace: monitoring
spec:
  ingressClassName: nginx
  rules:
  - host: grafana.ntmaorong.com
    http:
      paths:
      - backend:
          service:
            name: grafana
            port:
              number: 3000
        path: /
        pathType: ImplementationSpecific
  - host: prometheus.ntmaorong.com
    http:
      paths:
      - backend:
          service:
            name: prometheus-k8s
            port:
              number: 9090
        path: /
        pathType: ImplementationSpecific
  - host: alertmanager.ntmaorong.com
    http:
      paths:
      - backend:
          service:
            name: alertmanager-main
            port:
              number: 9093
        path: /
        pathType: ImplementationSpecific

启动

kubectl create -f prometheus-ingress.yaml 

配置本地hosts:

10.10.246.27 grafana.ntmaorong.com
10.10.246.27 alertmanager.ntmaorong.com
10.10.246.27 prometheus.ntmaorong.com

页面访问
grafana的默认账户密码:
admin admin


prometheus


alertmanager

标签:kube,ntmaorong,grafana,prometheus,alertmanager,k8s,com
From: https://www.cnblogs.com/zoujiaojiao/p/16921817.html

相关文章