侧边栏壁纸
  • 累计撰写 208 篇文章
  • 累计创建 16 个标签
  • 累计收到 5 条评论

目 录CONTENT

文章目录

prometheus-operator的安装

Wake
2022-09-05 / 0 评论 / 0 点赞 / 1,125 阅读 / 348 字

1.prometheus-operator的安装,监控后期的各种监控指标:

按照 helm3 部署教程,完成 helm3 部署以后,通常就设置 helm 源 优先选择国外的helm 源,因为国内的阿里云的helm chart源的版本比起国外更新是没有那么及时的,会落后了几个版本。

-国外 helm 源

# 导入国外源
helm repo remove stable
helm repo add stable https://charts.helm.sh/stable
helm repo update
helm list
helm search repo stable/prometheus-operator
# 查看是否存在可获取的 helm 资源
helm search repo stable/prometheus-operator
# 保存资源到本地
helm pull stable/prometheus-operator 
# 拷贝保存的 helm 资源tgz的包到国内集群环境中来(同理镜像或者其他资源的获取方式也是一样的)

image-1662379444247

# 创建资源部署的 namespace
kubectl create ns monitoring

# 安装 prometheus-operator
helm install -n monitoring prometheus-operator prometheus-operator-9.3.2.tgz

# 查询grafana的初始密码
kubectl get secret --namespace monitoring  prometheus-operator-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo

注意问题:如果之前部署过一次prometheus-operator,第二次部署会因为之前配置文件的残留,报如下错误:
image-1662379473659
解决方法如下:
删除资源validatingwebhookconfigurations.admissionregistration.k8s.io和MutatingWebhookConfiguration,重新等待helm部署创建就可以了。
image-1662379490813

#kubectl delete validatingwebhookconfigurations.admissionregistration.k8s.io prometheus-operator-admission
#kubectl delete MutatingWebhookConfiguration prometheus-operator-admission

部署完成后,如下图:
image-1662379519319

0

评论区