0

I am trying to deploy heapster in a cluster and collect metrics and store it in Influxdb. I can provide sink for Influxdb. But I am not sure how to provide the value for --source flag to connect to the secured kube API server. Can someone help me to find out this.

Note: I am trying to deploy heapster in the same cluster where the kube API server is running.

Thanks in advance.

Sujai Sivasamy
  • 1,101
  • 3
  • 14
  • 32
  • What version of Kubernetes are you using? And is it on Google Container Engine? – Mathew May 02 '17 at 19:19
  • Yes, its running on Google Container Engine. Master version is 1.5.6 and the heapster docker image that I used to deploy is kubernetes/heapster:v0.13.0 – Sujai Sivasamy May 03 '17 at 04:55

2 Answers2

1

I use heapster with parameter

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

  • inClusterConfig=false means I don't use serviceaccount in cluster.
  • insecure=true means I trust ApiServer in this cluster.
  • Most importantly, auth=/etc/kubernetes/admin.conf is the auth config when try to connect to ApiServer, this is the same kubeconfig your kubectl/kubelet use. You can mount this config into heapster pod using Configmap or normal Volume.

More source configuration, you can ref here

Crazykev
  • 392
  • 1
  • 9
  • Thanks for the reply. But unfortunately I couldn't find any /etc/kubernetes/admin.conf file in the specified location. Is there any other file that I can use for authentication? – Sujai Sivasamy May 05 '17 at 09:53
0

I found out the solution for this. The parameter that I am using is

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

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

I mounted /var/lib/kube-proxy/kubeconfig to the heapster container which is used by the kube-proxy and now the heapster can talk to the secured API server. Also I changed the heapster image to gcr.io/google_containers/heapster:v1.2.0

Note: InfluxDB must be of the latest version in order to make this work. I am using v1.2

I am not sure if this is the right method. But it works out for me.

Thank you for all responses.

Sujai Sivasamy
  • 1,101
  • 3
  • 14
  • 32