在Rancher管理的本地k8s集群上部署kube Prometheus组件

kube-prometheus安装与配置 1.kube-prometheus下载,解压,进入目录 1 2 3 wgets https://github.com/prometheus-operator/kube-prometheus/archive/refs/tags/v0.13.0.tar.gz tar -xf v0.13.0.tar.gz cd kube-prometheus-0.13.0/manifests/ 2.修改prometheus、grafana、alertmanager的ingress文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 #下面这个是prometheus-ingress.yaml,grafana-ingress.yaml和alertmanager-ingress.yaml内容类似 apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: prometheus-k8s-ingress namespace: monitoring annotations: field.cattle.io/publicEndpoints: >- [{"addresses":["192.168.1.181","192.168.1.182","192.168.1.183","192.168.1.184","192.168.1.185"],"port":443,"protocol":"HTTPS","serviceName":"monitoring:prometheus-k8s","ingressName":"monitoring:prometheus-k8s-ingress","hostname":"prometheus.ga.skyvault.cn","path":"/","allNodes":false}] kubernetes.io/ingress.class: "nginx" prometheus.io/http_probe: "true" spec: ingressClassName: nginx rules: - host: prometheus.ga.skyvault.cn http: paths: - path: / pathType: Prefix backend: service: name: prometheus-k8s port: number: 9090 tls: - hosts: - prometheus.ga.skyvault.cn secretName: skyvault-cn-tls-certificate status: loadBalancer: ingress: - ip: 192.168.1.181 - ip: 192.168.1.182 - ip: 192.168.1.183 - ip: 192.168.1.184 - ip: 192.168.1.185 3.镜像可能拉取不到,需要修改拉取的源 将镜像源改成私有镜像仓库 ...

2025-06-23 · 6 分钟 · HZhang