例如,我的 Route 53 托管区域是 myzone.com
。由 kops 创建了一个 Kubernetes 集群,集群全名:earth.myzone.com
。
我试图以这种方式安装普罗米修斯:
helm install prometheus
--set alertmanager.ingress.enabled=true
--set alertmanager.ingress.hosts=[alertmanager.earth.myzone.com]
--set pushgateway.ingress.enabled=true
--set pushgateway.ingress.hosts=[pushgateway.earth.myzone.com]
--set server.ingress.enabled=true
--set server.ingress.hosts=[server.earth.myzone.com]
出现错误:
zsh: no matches found: alertmanager.ingress.hosts=[alertmanager.earth.myzone.com]
或者将子域命名为 myzone.com
?
helm install prometheus
--set alertmanager.ingress.enabled=true
--set alertmanager.ingress.hosts=[alertmanager.myzone.com]
--set pushgateway.ingress.enabled=true
--set pushgateway.ingress.hosts=[pushgateway.myzone.com]
--set server.ingress.enabled=true
--set server.ingress.hosts=[server.myzone.com]
也是同样的错误。
如果使用 ELB 通过部署和服务清单文件部署应用程序,则需要像aws route53 change-resource-record-sets ...
一样创建 DNS 记录。然后网址会喜欢:
app.earth.myzone.com
但是,如果只想部署Prometheus
,该怎么办?
编辑
使用@fiunchinho的方法再次运行,成功完成:
$ helm install prometheus
> --set alertmanager.ingress.enabled=true
> --set "alertmanager.ingress.hosts={alertmanager.earth.myzone.com}"
> --set pushgateway.ingress.enabled=true
> --set "pushgateway.ingress.hosts={pushgateway.earth.myzone.com}"
> --set server.ingress.enabled=true
> --set "server.ingress.hosts={server.earth.myzone.com}"
NAME: auxilliary-pronghorn
E0129 01:41:06.224401 15782 portforward.go:303] error copying from remote stream to local connection: readfrom tcp4 127.0.0.1:42993->127.0.0.1:55840: write tcp4 127.0.0.1:42993->127.0.0.1:55840: write: broken pipe
LAST DEPLOYED: Mon Jan 29 01:41:05 2018
NAMESPACE: default
STATUS: DEPLOYED
RESOURCES:
==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
auxilliary-pronghorn-prometheus-alertmanager ClusterIP 100.68.246.60 <none> 80/TCP 1s
auxilliary-pronghorn-prometheus-kube-state-metrics ClusterIP None <none> 80/TCP 1s
auxilliary-pronghorn-prometheus-node-exporter ClusterIP None <none> 9100/TCP 1s
auxilliary-pronghorn-prometheus-pushgateway ClusterIP 100.69.211.226 <none> 9091/TCP 1s
auxilliary-pronghorn-prometheus-server ClusterIP 100.71.5.220 <none> 80/TCP 1s
==> v1beta1/DaemonSet
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
auxilliary-pronghorn-prometheus-node-exporter 2 2 0 2 0 <none> 0s
==> v1beta1/Deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
auxilliary-pronghorn-prometheus-alertmanager 1 1 1 0 0s
auxilliary-pronghorn-prometheus-kube-state-metrics 1 1 1 0 0s
auxilliary-pronghorn-prometheus-pushgateway 1 1 1 0 0s
auxilliary-pronghorn-prometheus-server 1 1 1 0 0s
==> v1beta1/Ingress
NAME HOSTS ADDRESS PORTS AGE
auxilliary-pronghorn-prometheus-alertmanager alertmanager.earth.myzone.com 80 0s
auxilliary-pronghorn-prometheus-pushgateway pushgateway.earth.myzone.com 80 0s
auxilliary-pronghorn-prometheus-server server.earth.myzone.com 80 0s
==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
auxilliary-pronghorn-prometheus-node-exporter-kjp25 0/1 ContainerCreating 0 0s
auxilliary-pronghorn-prometheus-node-exporter-r2sfn 0/1 ContainerCreating 0 0s
auxilliary-pronghorn-prometheus-alertmanager-684bb4bf8d-lq5z9 0/2 Pending 0 0s
auxilliary-pronghorn-prometheus-kube-state-metrics-69478d6lwdpq 0/1 ContainerCreating 0 0s
auxilliary-pronghorn-prometheus-pushgateway-6f97d7bc4d-jvj2c 0/1 ContainerCreating 0 0s
auxilliary-pronghorn-prometheus-server-65974d66bc-876rt 0/2 Pending 0 0s
==> v1/ConfigMap
NAME DATA AGE
auxilliary-pronghorn-prometheus-alertmanager 1 1s
auxilliary-pronghorn-prometheus-server 3 1s
==> v1/PersistentVolumeClaim
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
auxilliary-pronghorn-prometheus-alertmanager Pending gp2 1s
auxilliary-pronghorn-prometheus-server Pending gp2 1s
NOTES:
The Prometheus server can be accessed via port 80 on the following DNS name from within your cluster:
auxilliary-pronghorn-prometheus-server.default.svc.cluster.local
From outside the cluster, the server URL(s) are:
http://server.earth.myzone.com
The Prometheus alertmanager can be accessed via port 80 on the following DNS name from within your cluster:
auxilliary-pronghorn-prometheus-alertmanager.default.svc.cluster.local
From outside the cluster, the alertmanager URL(s) are:
http://alertmanager.earth.myzone.com
The Prometheus PushGateway can be accessed via port 9091 on the following DNS name from within your cluster:
auxilliary-pronghorn-prometheus-pushgateway.default.svc.cluster.local
From outside the cluster, the pushgateway URL(s) are:
http://pushgateway.earth.myzone.com
For more information on running Prometheus, visit:
https://prometheus.io/
(我在这里将我的真实域名更改为假域名(
但是当我尝试访问这三个服务时:
- http://server.earth.myzone.com
- http://alertmanager.earth.myzone.com
- http://pushgateway.earth.myzone.com
所有这些都无法访问。我不知道为什么。如何调试或查找原因?
此错误
zsh: 未找到匹配项: alertmanager.ingress.hosts=[alertmanager.earth.myzone.com]
是你的外壳,zsh,抱怨,因为它认为你正在尝试执行与之相关的东西。使用引号来避免这种情况。此外,Helm 希望列表使用大括号。
helm install prometheus
--set alertmanager.ingress.enabled=true
--set "alertmanager.ingress.hosts={alertmanager.earth.myzone.com}"
--set pushgateway.ingress.enabled=true
--set "pushgateway.ingress.hosts={pushgateway.earth.myzone.com}"
--set server.ingress.enabled=true
--set "server.ingress.hosts={server.earth.myzone.com}"