目录

介绍

镜像下载

服务安装

安装prometheus-operator

查看custom metrics api

获取prometheus端口

配置ingress

页面展示

导入grafana仪表盘


介绍

名称配置版本系统版本
master4核8G1.20.1centos7.9
node12核4G1.20.1centos7.9
node22核4G1.20.1centos7.9
node32核4G1.20.1centos7.9
prometheus-operator-v0.9.0-

prometheus-operator下载地址

prometheus-镜像下载地址

prometheus-包下载

镜像下载

下载镜像 [0.9.0]
docker pull quay.io/prometheus/alertmanager:v0.21.0
docker pull quay.io/prometheus/blackbox-exporter:v0.18.0
docker pull jimmidyson/configmap-reload:v0.5.0
docker pull quay.io/brancz/kube-rbac-proxy:v0.9.0
docker pull grafana/grafana:7.5.4
docker pull k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.1.1
docker pull quay.io/prometheus/node-exporter:v1.1.2
docker pull k8s.gcr.io/prometheus-adapter/prometheus-adapter:v0.9.0
docker pull quay.io/prometheus/prometheus:v2.26.0
docker pull quay.io/prometheus-operator/prometheus-operator:v0.47.0

镜像0.9.0

服务安装

[root@k8s-master ~]# wget https://codeload.github.com/prometheus-operator/kube-prometheus/tar.gz/refs/tags/v0.9.0
[root@k8s-master ~]# tar xf v0.9.0
[root@k8s-master ~]# cd kube-prometheus-0.9.0/manifests

安装prometheus-operator

[root@k8s-master ~]# kubectl apply -f setup/
[root@k8s-master ~]# kubectl get pods -n monitoring # 查看pod全部RUNNING之后再执行后面指令


[root@k8s-master ~]# kubectl apply -f .
[root@k8s-master ~]# kubectl get pods -n monitoring # 等待podRUNNING

查看custom metrics api

[root@k8s-master ~]# kubectl get apiservices -n monitoring | grep metrics

获取prometheus端口

[root@k8s-master ~]# kubectl get svc -n monitoring

配置ingress

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress
  namespace: monitoring
  labels:
    name: ingress
spec:
  ingressClassName: nginx
  rules:
  - host: grafana.qf.com
    http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: grafana
            port: 
              number: 3000
  - host: prometheus.qf.com
    http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: prometheus-k8s
            port: 
              number: 9090
  - host: alert.qf.com
    http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: alertmanager-main
            port: 
              number: 9093

页面展示

prometheus.qf.com

alert.qf.com

grafana.qf.com

导入grafana仪表盘

仪表盘id 13105 、8919

13105

8919

 希望能够帮助到大家!!!

Logo

一起探索未来云端世界的核心,云原生技术专区带您领略创新、高效和可扩展的云计算解决方案,引领您在数字化时代的成功之路。

更多推荐