2017-05-02 26 views
0

我试图在群集中部署heapster并且收集信息并将其存储在Influxdb。我可以提供水槽Influxdb。但我不知道如何提供--source标志的值以连接到安全的kube API服务器的。有人可以帮我找出这个。提供身份验证heapster连接到安全的KUBE API服务器GKE

注:我试图在运行kube API服务器的同一群集中部署heapster。

在此先感谢。

+0

您使用的是什么版本的Kubernetes?它在Google Container Engine上吗? – Mathew

+0

是的,它运行在Google Container Engine上。主版本是1.5.6,我用来部署的heapster docker映像是kubernetes/heapster:v0.13.0 –

回答

0

我发现了这个解决方案。我使用的参数是

--source = kubernetes:https://masterIP?auth=/var/lib/kube-proxy/kubeconfig&apiVersion=v1

--sink = influxdb:http://influxdbIP:8086?user=xxx&pw=xxx&db=xxx

我安装/var/lib/kube-proxy/kubeconfig到用于由KUBE的heapster容器-proxy,现在heapster可以与安全的API服务器通信。 我也改变了heapster图像gcr.io/google_containers/heapster:v1.2.0

注:InfluxDB必须为了使这项工作是最新版本。我正在使用v1.2

我不确定这是否是正确的方法。但它适合我。

谢谢你的回应。

1

我使用heapster与参数

--source = kubernetes:http://kubernetes.default?inClusterConfig=false&insecure=true&auth=/etc/kubernetes/admin.conf

  • inClusterConfig=false意味着我不集群中使用serviceaccount。
  • insecure=true表示我信任此群集中的ApiServer。
  • 最重要的是,auth=/etc/kubernetes/admin.conf是尝试连接到ApiServer时的auth配置,这与kubectl/kubelet使用的kubeconfig相同。您可以使用Configmap或普通卷将此配置挂载到heapster pod。

多个源的配置,可以参考here

+0

感谢您的回复。但不幸的是我找不到指定位置的任何/etc/kubernetes/admin.conf文件。是否有任何其他文件可用于身份验证? –

相关问题