Day-3 | Node Selector, Node Affinity, Taints and Tolerations | Kubernetes Zero to Hero

Day-3 | Node Selector, Node Affinity, Taints and Tolerations | Kubernetes Zero to Hero

Support my work
https://www.buymeacoffee.com/abhishekprd

In Kubernetes, the scheduler is responsible for assigning pods to nodes in the cluster based on various criteria. Sometimes, you might encounter situations where pods are not being scheduled as expected. This can happen due to factors such as node constraints, pod requirements, or cluster configurations.

1. Node Selector
Node Selector is a simple way to constrain pods to nodes with specific labels. It allows you to specify a set of key-value pairs that must match the node’s labels for a pod to be scheduled on that node.
Usage: Include a nodeSelector field in the pod’s YAML definition to specify the required labels.

2. Node Affinity
Node Affinity is a more expressive way to specify rules about the placement of pods relative to nodes’ labels. It allows you to specify rules that apply only if certain conditions are met.
Usage: Define nodeAffinity rules in the pod’s YAML definition, specifying required and preferred node selectors.

3. Taints
Taints are applied to nodes to repel certain pods. They allow nodes to refuse pods unless the pods have a matching toleration.
Usage: Use kubectl taint command to apply taints to nodes. Include tolerations field in the pod’s YAML definition to tolerate specific taints.

4. Tolerations
Tolerations are applied to pods and allow them to schedule onto nodes with matching taints. They override the effect of taints.
Usage: Include tolerations field in the pod’s YAML definition to specify which taints the pod tolerates.

GitHub Repo
https://github.com/iam-veeramalla/kubernetes-troubleshooting-zero-to-hero/

Here are some more very useful Zero to Hero playlists on the channel.
– Free DevOps Playlist: https://www.youtube.com/playlist?list=PLdpzxOOAlwvIKMhk8WhzN1pYoJ1YU8Csa
– AWS Zero to Hero Playlist: https://www.youtube.com/playlist?list=PLdpzxOOAlwvLNOxX0RfndiYSt1Le9azze
– Terraform Zero to Hero Playlist: https://www.youtube.com/playlist?list=PLdpzxOOAlwvI0O4PeKVV1-yJoX2AqIWuf
– Python for DevOps Playlist: https://www.youtube.com/playlist?list=PLdpzxOOAlwvKwTyYNJCUwGPvql0TrsPgv

Have any questions while learning ? Don’t worry, Join our Doubts Clearing Group.
Join our Doubts Clearing Group
https://www.youtube.com/@AbhishekVeeramalla/join

About me:
========
Instagram: https://www.instagram.com/abhishekveeramalla_official/
Telegram Channel : https://t.me/abhishekveeramalla
LinkedIn: https://www.linkedin.com/in/abhishek-veeramalla
GitHub: https://github.com/iam-veeramalla
Medium: https://abhishekveeramalla-av.medium.com/