kops icon indicating copy to clipboard operation
kops copied to clipboard

HPA: failed to get CPU consumption and request

Open brvtl opened this issue 10 years ago • 5 comments

Version:

kubectl version
Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.1+33cf7b9", GitCommit:"33cf7b9acbb2cb7c9c72a10d6636321fb180b159", GitTreeState:"not a git tree", BuildDate:"2016-10-13T15:18:15Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.0", GitCommit:"a16c0a7f71a6f93c7e0f222d961f4675cd97a46b", GitTreeState:"clean", BuildDate:"2016-09-26T18:10:32Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}

As per https://github.com/kubernetes/kops/blob/master/docs/addons.md I have run kubectl create -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/monitoring-standalone/v1.2.0.yaml on my cluster. It has the pods currently running:

NAME                                                    READY     STATUS    RESTARTS   AGE
dns-controller-527600570-6258y                          1/1       Running   0          10d
elasticsearch-logging-v1-2carl                          1/1       Running   0          10d
elasticsearch-logging-v1-5p5tm                          1/1       Running   0          10d
etcd-server-events-ip-172-20-122-30.ec2.internal        1/1       Running   0          10d
etcd-server-ip-172-20-122-30.ec2.internal               1/1       Running   0          10d
fluentd-elasticsearch-v1-144es                          1/1       Running   0          9d
fluentd-elasticsearch-v1-5f4xq                          1/1       Running   0          9d
heapster-4110984930-ipxzv                               2/2       Running   0          10d
kibana-logging-v1-5tugv                                 1/1       Running   0          10d
kube-apiserver-ip-172-20-127-30.ec2.internal            1/1       Running   3          10d
kube-controller-manager-ip-172-20-122-30.ec2.internal   1/1       Running   0          10d
kube-dns-v20-3531996453-jtyco                           3/3       Running   0          10d
kube-dns-v20-3531996453-tii8m                           3/3       Running   0          10d
kube-proxy-ip-172-20-122-247.ec2.internal               1/1       Running   0          10d
kube-proxy-ip-172-20-122-248.ec2.internal               1/1       Running   0          10d
kube-proxy-ip-172-20-122-30.ec2.internal                1/1       Running   0          10d
kube-scheduler-ip-172-20-122-30.ec2.internal            1/1       Running   0          10d
kubernetes-dashboard-1655269645-p2g9n                   1/1       Running   0          10d

However, it would appear that the hpa doesn't work:

kubectl describe hpa some-hpa gives the following output:

Events:
  FirstSeen LastSeen    Count   From                SubobjectPath   Type        Reason          Message
  --------- --------    -----   ----                -------------   --------    ------          -------
  8m        16s     22  {horizontal-pod-autoscaler }            Warning     FailedGetMetrics    failed to get CPU consumption and request: failed to unmarshall heapster response: json: cannot unmarshal array into Go value of type v1alpha1.PodMetricsList
  8m        16s     22  {horizontal-pod-autoscaler }            Warning     FailedComputeReplicas   failed to get CPU utilization: failed to get CPU consumption and request: failed to unmarshall heapster response: json: cannot unmarshal array into Go value of type v1alpha1.PodMetricsList

The HPA is very simple:

apiVersion: extensions/v1beta1
kind: HorizontalPodAutoscaler
metadata:
  name: moo
  namespace: default
spec:
  cpuUtilization:
    targetPercentage: 50
  maxReplicas: 10
  minReplicas: 2
  scaleRef:
    apiVersion: extensions/v1beta1
    kind: Deployment
    name: moo
    subresource: scale

brvtl avatar Oct 25 '16 21:10 brvtl

So not sure this is a kops issue. You may want to file and issue with the heapster folks.

chrislovecnm avatar Oct 26 '16 03:10 chrislovecnm

Please close if this is not a kops issue.

chrislovecnm avatar Oct 26 '16 03:10 chrislovecnm

@petergarbers could this be a SG issue? We noticed that heapster cannot talk to kubelet, because of the Security Group being locked down. Thoughts?

chrislovecnm avatar Oct 30 '16 15:10 chrislovecnm

I did not do anything out of the box when setting up the cluster so I doubt that it's a security group issue. I was messing around with it today. It started working after I removed all the containers that were present before I added heapster to the cluster. Perhaps it has something to do with that?

brvtl avatar Oct 30 '16 18:10 brvtl

@petergarbers sizing and headroom :)

chrislovecnm avatar Oct 30 '16 18:10 chrislovecnm