Answers: <p>I think you can do this by Nodeselector. Firstly add a label for node selector in your daemonset config. Then label your nodes with the attached label. Now if you can set the autoscaling thresholds, it will be deployed on that node automatically on nodes that matches the label. Maybe you can tweak somehow to attach a label to your node when it is added to your pool. </p>
  
  <p>Also, with Kubernetes 1.6+, we have the feature of rolling update strategy which is far better than onDelete. </p>
  
  <p>Cheers</p>
  
Answers: CC BY-SA 4.0
Answers: 2018-11-09T20:50:41.390Z
Answers: 2018-11-09T20:50:41.390Z
Answers: CR7
Body: <p>I have a Kubernetes cluster running on Google Compute Engine. My program uses stateful connections, so I do not want my pods being moved between nodes. Because of this, I am running my workload as daemonsets, and giving each node the amount of compute power that one pod needs.</p>
  
  <p><a href="https://i.sstatic.net/oW31U.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oW31U.png" alt="enter image description here"></a></p>
  
  <p>This system is working, but I would like a way to autoscale. Normally, the high workload would produce more pods, which would then trigger the creation of more nodes. But since I am only using daemon sets, this normal solution will not work.</p>
  
  <p>I can use commands to increase or decrease the number of nodes in the server, but I would like this to happen automatically. Ideally, when the workload is high, the cluster would spawn another node in its node pool. Even better, if there is a solution to autoscale down the number of nodes, while minimizing closed connections.</p>
  
  <p>I haven't found much information on ways to do this. I am not very experienced with dev ops, kubernetes, google cloud, docker, etc. so I would appreciate explanatory answers.</p>
  
  <p>Thank you.</p>
  
Tags: <kubernetes><google-cloud-platform><autoscaling><google-compute-engine>
Title: Autoscaling with Kubernetes daemonset
UserDisplayName: Phoenix
ThreadText: # Autoscaling with Kubernetes daemonset
  
  (Asked by: username_0 on 2018-09-24)
  
  I have a Kubernetes cluster running on Google Compute Engine. My program uses stateful connections, so I do not want my pods being moved between nodes. Because of this, I am running my workload as daemonsets, and giving each node the amount of compute power that one pod needs.
  
  [![enter image description here](https://i.sstatic.net/oW31U.png)](https://i.sstatic.net/oW31U.png)
  
  This system is working, but I would like a way to autoscale. Normally, the high workload would produce more pods, which would then trigger the creation of more nodes. But since I am only using daemon sets, this normal solution will not work.
  
  I can use commands to increase or decrease the number of nodes in the server, but I would like this to happen automatically. Ideally, when the workload is high, the cluster would spawn another node in its node pool. Even better, if there is a solution to autoscale down the number of nodes, while minimizing closed connections.
  
  I haven't found much information on ways to do this. I am not very experienced with dev ops, kubernetes, google cloud, docker, etc. so I would appreciate explanatory answers.
  
  Thank you.
  
  **Tags:** kubernetes, google-cloud-platform, autoscaling, google-compute-engine
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-11-09. Score: 1
  
  I think you can do this by Nodeselector. Firstly add a label for node selector in your daemonset config. Then label your nodes with the attached label. Now if you can set the autoscaling thresholds, it will be deployed on that node automatically on nodes that matches the label. Maybe you can tweak somehow to attach a label to your node when it is added to your pool.
  
  Also, with Kubernetes 1.6+, we have the feature of rolling update strategy which is far better than onDelete.
  
  Cheers
  
  
  ---
  
  