<p>I am a new cookie to kubernetes . I am wondering if kubernetes have automatically switch the pods to another node if that node resources are on critical.</p>

<p>For example if Pod A , Pod B , Pod C is running on Node A and Pod D is running on Node B. The resources of Node A used by pods would be high. In these case whether kubernetes will migrate the any of the pods running in Node A to Node B.</p>

<p>I have learnt about node affinity and node selector which is used to run the pods in certain nodes. It would be helpfull if kubernetes offer this feature to migrate the pods to another node automatically if resources are used highly.</p>

<p>Can any one know how can we achieve this in kubernetes ?</p>

<p>Thanks 
-S</p>

<p>Yes, Kubernetes can migrate the pods to another node automatically if resources are used highly.  The pod would be killed and a new pod would be started on another node. You would probably want to learn about <a href="https://medium.com/google-cloud/quality-of-service-class-qos-in-kubernetes-bb76a89eb2c6" rel="noreferrer">Quality of Service Classes</a>, to understand which pod would be killed first. </p>

<p>That said, you may want to read about <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="noreferrer">Automatic Horizontal Pod Autoscaling</a>. This may give you more control. </p>

<blockquote>
  <p>With Horizontal Pod Autoscaling, Kubernetes automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization (or, with alpha support, on some other, application-provided metrics).</p>
</blockquote>
