【发布时间】:2020-03-18 20:54:42
【问题描述】:
我想在 GKE 集群上安装 helm 图表 stable/prometheus-operator。我知道需要调整防火墙规则或需要通过设置prometheusOperator.admissionWebhooks.enabled=false 禁用挂钩(有关详细信息,请参阅图表的README)。
但是,如果我用
安装图表 - wget -qq https://get.helm.sh/helm-v3.0.0-linux-amd64.tar.gz && tar xf helm-v3.0.0-linux-amd64.tar.gz && mv linux-amd64/helm /usr/local/bin
- helm repo add stable https://kubernetes-charts.storage.googleapis.com/
- helm repo update
- kubectl create ns monitoring
- kubectl apply -f https://raw.githubusercontent.com/coreos/prometheus-operator/master/example/prometheus-operator-crd/alertmanager.crd.yaml
- kubectl apply -f https://raw.githubusercontent.com/coreos/prometheus-operator/master/example/prometheus-operator-crd/prometheus.crd.yaml
- kubectl apply -f https://raw.githubusercontent.com/coreos/prometheus-operator/master/example/prometheus-operator-crd/prometheusrule.crd.yaml
- kubectl apply -f https://raw.githubusercontent.com/coreos/prometheus-operator/master/example/prometheus-operator-crd/servicemonitor.crd.yaml
- kubectl apply -f https://raw.githubusercontent.com/coreos/prometheus-operator/master/example/prometheus-operator-crd/podmonitor.crd.yaml
- helm install monitoring stable/prometheus-operator --namespace=monitoring --wait --timeout 10m --set prometheusOperator.admissionWebhooks.enabled=false
在 GitLab CI 中,pod prometheus-operator 有两个容器,它们保持“待处理”状态 5 分钟。我希望这个相当简单的设置可以在一分钟内完成。
您可以在https://gitlab.com/krichter/prometheus-operator-503/-/jobs/358887366 上检查集群设置。
Installing Prometheus on GKE + istio 中显示的方法不适用,因为我没有安装 istio。
【问题讨论】:
-
当您的 pod 处于
Pending状态时,请使用kubectl describe pod $pod_name来查看(在输出底部)来自该 pod 的事件。它们可能会显示阻止 pod 在 GKE 中正确调度的问题
标签: kubernetes google-kubernetes-engine prometheus kubernetes-helm prometheus-operator