- 下载
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