<p>I am fairly new to the kubernetes engine and I have a use case that I can't seem to make working. I want to have each pod run in only one dedicated node and then autoscale the cluster.</p>

<p>For now I have tried using a DaemonSet to run each pod and I have created an HorizontalPodAutoscaler targeting the nodepool.</p>

<pre><code>apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: test
spec:
  selector:
    matchLabels:
      app: test
  template:
    metadata:
      labels:
        app: test
    spec:
      containers:
      - name: actions
        image: image_link
      nodeSelector:
        cloud.google.com/gke-nodepool: test
  updateStrategy:
    type: RollingUpdate
---
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: test
spec:
  scaleTargetRef:
    apiVersion: extensions/v1beta1
    kind: DaemonSet
    name: test
  minReplicas: 1
  maxReplicas: 2
  metrics:
  - type: Resource
    resource:
      name: cpu
      targetAverageUtilization: 80
</code></pre>

<p>I then use the stress utility to test the autoscaling process but the number of nodes stays constant. Is there something I am missing here ? Is there another component I can use for my use case ?</p>

maelorn
<p>HorizontalPodAutoscaler is used to scale the pods depending on the metrics limit. It is not applicable to daemonset.</p>

<p>Daemonset deploys one pod on each node in the cluster. If you want to scale daemonset you need to scale your nodepool. 
HorizontalPodAutoscaler is best used to auto scale deployment objects. In your case, change the daemonset object to deployment object or scale out the nodepool. Auto scaling of nodes is supported on Google cloud platform. Not sure about other cloud providers. You need to check your cloud provider documentation</p>
