繁体   English   中英

Kubernetes无法访问Google云端平台的grafana和Prometheus

[英]Kubernetes cannot access grafana and prometheus fron Google cloud platform

我已点击此链接在Google Cloud kubernetes中安装Grafana / Prometheus。 我希望它已成功部署,请找到以下响应以供参考,

服务创建成功:

kubectl --namespace=monitoring get services
NAME         TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
grafana      NodePort   10.27.249.8     <none>        3000:32703/TCP   1h
prometheus   NodePort   10.27.249.233   <none>        9090:31939/TCP   1h

命名空间创建成功:

kubectl get namespaces
NAME          STATUS    AGE
default       Active    19h
kube-public   Active    19h
kube-system   Active    19h
monitoring    Active    1h

PODS响应:

kubectl --namespace=monitoring get pods
NAME                          READY     STATUS             RESTARTS   AGE
grafana-1323121529-8614m      1/1       Running            0          1h
node-exporter-lw8cr           0/1       CrashLoopBackOff   17         1h
node-exporter-nv85s           0/1       CrashLoopBackOff   17         1h
node-exporter-r2rfl           0/1       CrashLoopBackOff   17         1h
prometheus-3259208887-x2zjc   1/1       Running            0          1h

现在,我正在尝试为Grafana公开外部IP,但我无法继续获取以下异常信息:“服务器错误(AlreadyExists):服务“ prometheus”已存在”

kubectl --namespace=monitoring expose deployment/prometheus --type=LoadBalancer

Error from server (AlreadyExists): services "prometheus" already exists

编辑

 kubectl -n monitoring edit service prometheus Edit cancelled, no changes made. 

由于您已经在监视名称空间中部署了Prometheus服务清单文件。 但是,您正在尝试在相同的名称空间中部署具有相同名称的服务,这是不可接受的,因为两个服务不能在具有相同名称的相同名称空间中共存。

解决问题的方法

我将使用以下命令来编辑已部署的服务。

kubectl -n monitoring edit service prometheus 

然后会弹出您喜欢的文本编辑器,您只需要更新类型即可:LoadBalancer

基本上,您的服务将被编辑。

编辑

如果无法使用上述命令,则请执行以下步骤:您需要编辑Prometheus服务清单文件,并使用以下类型更新它:LoadBalancer

现在您需要应用 kubectl apply -f prometheus-service.yaml

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM