kubernetes+prometheus+grafana
文章目录
版本
| 组件 | 版本 |
|---|---|
| kubernetes | 1.23.4 |
| prometheus | 2.34.0 |
| node-exporter | 1.3.1 |
| grafana | 8.4.6 |
参考资料
prometheus官方:https://prometheus.io/docs/pr...
prometheus官方镜像:https://hub.docker.com/r/prom...
prometheus官方示例:https://github.com/prometheus...
node-exporter官方镜像:https://hub.docker.com/r/prom...
kubernetes-rbad官方:https://kubernetes.io/zh/docs...
rbac配置文件参考prometheus-operator官方:https://github.com/prometheus...
prometheus配置文件参考prometheus官方:https://github.com/prometheus...
https://github.com/prometheus...
prometheu部署
#生成deployment
kubectl create deployment prometheus --image=prom/prometheus:v2.34.0 --dry-run=client -o yaml > prometheus-deployment.yaml#生成service
kubectl expose deployment prometheus --port=9090 --type=NodePort --target-port=9090 --name=prometheus -o yaml > prometheus-service.yamlgrafana部署
#生成deployment
kubectl create deployment grafana --image=grafana/grafana-oss:8.4.6 --dry-run=client -o yaml > grafana-deployment.yaml#生成service
kubectl expose deployment grafana --port=3000 --type=NodePort --target-port=3000 --name=grafana --dry-run=client -o yaml > grafana-service.yamlnode-exporter部署
#生成deployment
kubectl create daemonset node-exporter --image=prom/node-exporter:v1.3.1 --dry-run=client -o yaml > node-exporter-daemonset.yaml#生成service
kubectl expose deployment node-exporter --port=9100 --type=NodePort --target-port=9100 --name=grafana --dry-run=client -o yaml > node-exporter-service.yaml常用命令
查看证书:
kubectl describe secrets prometheus-token进入某个pod内部:
kubectl exec -it prometheus-f644d7748-wzf4k -- sh

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论