kubernetes tutorial | Scheduling Pods to Nodes | Node Affinity | Demo

preview_player
Показать описание
*Certified Kubernetes Administrator*
------------------------------------------------------------
kubernetes tutorial | Scheduling Pods to Nodes | Node Affinity | Demo

*Description*
----------------------

In this video, you are going to learn the concepts of Scheduling pods to nodes using Node Affinity and we are also going to see a demo on the same as well.

*Kubernetes - Scheduling Pods to Nodes using NodeAffinity*
---------------------------------------------------------------------------------------------------

1. Scheduling Pods to Nodes using “Node Affinity”
2. Scheduling Pods to Nodes Using Labels
3. Recap - NodeSelector
4. Node Affinity
5. Types of Node Affinity
6. Use Cases
7. DEMO: Scheduling Pods to Nodes using “Node Affinity”
8. Thank you

For suggestions/feedback/doubts contact

Happy Learning !!!

========================================================================================

*USEFUL LINKS*
----------------------------

*Assigning Pods to Nodes*

*Assigning Pods to Nodes using Node Affinity*

*API References*

*Kubectl Command Reference*

==========================================================================================
#vsparkz #kubernetes #k8s #containers

*DEMO STEPS*
-------------------------

*Step 1: Access & Inspect the Kubernetes Cluster*

$ kubectl cluster-info

$ kubectl get nodes

$ kubectl get pods -n kube-system

*Step 2: Add custom labels to the Nodes*

*Step 3: Create & Schedule a Pod using “Required” Affinity Type*

$ kubectl run nginx --image=nginx --dry-run=client -o yaml

_______________________________________________________
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- image: nginx
name: nginx
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: webserver
operator: In
values:
- nginx
_______________________________________________________

$ kubectl get pods -o wide

*Step 4: Create & Schedule a Pod using “Preferred” Affinity Type*

_______________________________________________________
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- image: nginx
name: nginx
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
preference:
matchExpressions:
- key: size
operator: In
values:
- large
_______________________________________________________

*Step 5: Create & Schedule a Pod using both “required” & “preferred” Affinity Type*

_______________________________________________________
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- image: nginx
name: nginx
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: workertype
operator: In
values:
- python
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 20
preference:
matchExpressions:
- key: size
operator: In
values:
- large
_______________________________________________________

$ kubectl get pods -o wide

========================================================================================================================
Рекомендации по теме
Комментарии
Автор

Thank you so much for the beautiful and clear explanation

rizkipurnama
Автор

Extraordinary - prefect - clear understanding

prabakaranp
Автор

Wow, what easy way to really you are doing great Nd superb sir 🙏

jalandharbehera
Автор

Very beautiful explanation bro. Animations are very good and very helpful to understand the core concepts behind the resources. Thank you so much for your wonderful explanation and animation video. Please make and upload more videos on Kubernetes resources like network policies, about calico plugin, stateful sets etc.

mohammedsuhailbasha
Автор

I have passed cka exam successfully after I frequently watch ur video's.. thank you so much for ur awesome teaching..

preethikannan
Автор

In the if the given node lables didn't match, how it will calculate weight?

kotapativenkatasaichand