kube-prometheus安装
prometheus监控k8s集群已经是业界公认的最佳解决方案,而kube-proemtheus作为监控套装,更是prometheus监控的最佳实践。话不多说,直接上操作。
首先,准备好一个k8s集群
打开kube-prometheus的版本发布页面:点这里
2022-4-5号最新版本是v0.10.0,现在zip文件。
wget https://github.com/prometheus-operator/kube-prometheus/archive/refs/tags/v0.10.0.zip
解压:
unzip v0.10.0.zip
进入解压后的目录,会看到有一个manifests的子目录,这里就有我们所需要的一切。用这个目录可直接部署kube-prometheus:
# create namespace and CRDs
kubectl create -f manifests/setup
# wait for CRD creation to complete
until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done
# create monitoring components
kubectl create -f manifests/
国内的用户会遇到墙的问题:
修改:
manif