<p>I have a replication controller running with the following spec:</p>

<pre><code>apiVersion: v1
kind: ReplicationController
metadata:
  name: owncloud-controller
spec:
  replicas: 1
  selector:
    app: owncloud
  template:
    metadata:
      labels:
        app: owncloud
    spec:
      containers:
      - name: owncloud
        image: adimania/owncloud9-centos7
        ports:
          - containerPort: 80
        volumeMounts:
          - name: userdata
            mountPath: /var/www/html/owncloud/data
        resources:
          requests:
            cpu: 400m
      volumes:
        - name: userdata
          hostPath:
            path: /opt/data
</code></pre>

<p>Now I run a hpa using autoscale command.</p>

<pre><code>$ kubectl autoscale rc owncloud-controller --max=5 --cpu-percent=10
</code></pre>

<p>I have also started heapster using kubernetes run command.</p>

<pre><code>$ kubectl run heapster --image=gcr.io/google_containers/heapster:v1.0.2 --command -- /heapster --source=kubernetes:http://192.168.0.103:8080?inClusterConfig=false --sink=log
</code></pre>

<p>After all this, the autoscaling never kicks in. From logs, it seems that the actual CPU utilization is not getting reported.</p>

<pre><code>$ kubectl describe hpa owncloud-controller
Name:               owncloud-controller
Namespace:          default
Labels:             &lt;none&gt;
Annotations:            &lt;none&gt;
CreationTimestamp:      Thu, 26 May 2016 14:24:51 +0530
Reference:          ReplicationController/owncloud-controller/scale
Target CPU utilization:     10%
Current CPU utilization:    &lt;unset&gt;
Min replicas:           1
Max replicas:           5
ReplicationController pods: 1 current / 1 desired
Events:
  FirstSeen LastSeen    Count   From                SubobjectPath   Type        Reason          Message
  --------- --------    -----   ----                -------------   --------    ------          -------
  44m       8s      92  {horizontal-pod-autoscaler }            Warning     FailedGetMetrics    failed to get CPU consumption and request: metrics obtained for 0/1 of pods
  44m       8s      92  {horizontal-pod-autoscaler }            Warning     FailedComputeReplicas   failed to get CPU utilization: failed to get CPU consumption and request: metrics obtained for 0/1 of pods
</code></pre>

<p>What am I missing here?</p>

<p>Most probably heapster is running in a wrong namespace ("default"). HPA expects heapster to be in "kube-system" namespace. Please, add --namespace=kube-system to kubectl run heapster command.</p>
