kubernetes+prometheus+grafana
创建prometheus容器
vim prometheus.yml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node
spec:
selector:
matchLabels:
app: node-prometheus
template:
metadata:
labels:
app: node-prometheus
spec:
hostNetwork: true
containers:
- name: node-prom
image: prom/prometheus
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9090
volumeMounts:
- name: proc
mountPath: /host/proc
- name: sys
mountPath: /host/sys
- name: root
mountPath: /rootfs
volumes:
- name: proc
hostPath:
path: /proc
- name: sys
hostPath:
path: /sys
- name: root
hostPath:
path: /
kubectl apply -f prometheus.yml
查看容器内prometheus ip地址
kubectl get pods -o wide
浏览器访问prometheus ip地址
部署grafana
rpm -ivh grafana-6.7.3-1.x86_64.rpm
systemctl start grafana
浏览器访问grafana ip:3000
浏览器访问nodes ip:9090