[ Kube 9.1 ] PodNodeSelector Admission Control Plugin | Assigning pods to nodes

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024
  • In this video I will show you how to use PodNodeSelector admission control plugin to assign pod that are deployed to a specific namespace to be scheduled on specific set of worker nodes. You might find yourself in a situation where you want to run production workloads and dev workloads in a separate set of hardware. Well, you can use node selectors to target appropriate nodes.
    PodNodeSelector:
    kubernetes.io/...
    Kubernetes Playlist:
    • Learn Kubernetes
    [ Kube 9 ] How to use Node Selector in Kubernetes
    • [ Kube 9 ] How to use ...
    Hope you enjoyed this video. Please share it with your friends and don't forget to subscribe to my channel. For any questions/issues/feedback, please leave me a comment and I will get back to you.
    Thanks for watching.
    If you wish to support me:
    www.paypal.com...
    #learnkubernetes #justmekubernetes #nodeselector #kubernetes

Комментарии • 49

  • @pavana2189
    @pavana2189 4 года назад

    Hi Venkat, I am searching out from past 6 months for understanding these node selector concept...once i have seen your video i got cleared all my doubts on these concept..great..keep it up bro

  • @DeepakKumar-fc3hn
    @DeepakKumar-fc3hn 4 года назад +1

    Got Very good understanding with this video

  • @andreideco
    @andreideco Год назад

    Thank you for the video, very useful
    One question: what if we want to have all pods from a deployment assigned to a particular namespace (so a set of workers) but in the same time some of those pods assigned to particular workers (out of the same set).
    I was thinking to use a PodNodeSelector (at namespace level) and additionally a NodeSelector (at pod level inside the yaml definition). These 2 would have different values, based on 2 different labels defined in the workers.
    Can a pod take 2 different nodeselector values in the same time - one from pod yaml and another inherited from namespace?
    Have you tested such scenario?

  • @MrMad13n
    @MrMad13n 3 года назад +1

    Hello and Thank you

    • @justmeandopensource
      @justmeandopensource  3 года назад +2

      Hi, thanks for watching. This was done a long time ago and probably things might have changed. But certainly that step was required back then.

    • @MrMad13n
      @MrMad13n 3 года назад +1

      @@justmeandopensource Thank you

    • @justmeandopensource
      @justmeandopensource  3 года назад +1

      @@MrMad13n no worries

  • @Suresh-zo3ed
    @Suresh-zo3ed 4 года назад +1

    Clear explanation. Thanks

  • @romantsyupryk3009
    @romantsyupryk3009 4 года назад +1

    Thanks so much for this tutorial.

  • @umeshbatra6825
    @umeshbatra6825 4 года назад

    Hello Venkat, Is PodNodeSelector internally uses NodeSelector ?

  • @manikandans8808
    @manikandans8808 4 года назад +5

    Its more and more interesting to learn k8s every week in @justmeandopensource ....@venkat cheers

    • @justmeandopensource
      @justmeandopensource  4 года назад +2

      HI Mani, thats great to hear and motivates me even more. Cheers.

  • @saicharana5361
    @saicharana5361 4 года назад

    Thanks you made that simple , I wanted if this can fit in any way to my scenario where I drained all nodes from unhealthy node1 to active node2 and pods not getting redistributes once node1 made healthy ? what should we do to make this happen , advise please

  • @tamilselvan8343
    @tamilselvan8343 4 года назад +1

    Hi Venkat sir,can u please give me a some clear explanation for admission controller and how it works on k8??

    • @justmeandopensource
      @justmeandopensource  4 года назад +2

      Hi, thanks for watching.
      You can find more details about Admission Controllers, what it is and why we need them in the below link.
      kubernetes.io/docs/reference/access-authn-authz/admission-controllers/
      I will see if I can do a video on it. But I have videos scheduled for the next two months.

    • @tamilselvan8343
      @tamilselvan8343 4 года назад +1

      @@justmeandopensource ok sir I will refer it.thanks for ur quick response.

    • @justmeandopensource
      @justmeandopensource  4 года назад +2

      @@tamilselvan8343 No worries.

  • @shanmugamn789
    @shanmugamn789 4 года назад +2

    Nice video, if possible set schedule restart or update base image to pod automatically.

    • @justmeandopensource
      @justmeandopensource  4 года назад +2

      HI Shanmugam, thanks for watching. How do you mean for scheduled restart and updating base image?

  • @realthought2262
    @realthought2262 4 года назад

    hello , how are you ? i want to ask you one thing i think this is best and easy approach " PodNodeSelector admission control plugin" if we want to deploy pods to particular node/s coz i was also going through node selectors and node affinity they do the same thing but node selector doesn't assure that it will be assigned to particular node without node affinity , so what you say which one should be best practise to achieve this one coz we can set this rule to our default name space also . kindly suggest what you think .

    • @justmeandopensource
      @justmeandopensource  4 года назад +1

      Hi, thanks for watching. The advantage of this method is that you can set this at the namespace level. So you don't have to specify it on every pod that you deploy.

  • @smityment674
    @smityment674 4 года назад

    Thanks for the great video. I have doubt
    When I use nodeselector as a worker node and disk type = hostpath.
    Pod is not assigned to that specific worker node. I just done labeling also. Could you please help me resolve this things sir

  • @mustufamithaiwala7205
    @mustufamithaiwala7205 4 года назад +2

    @venkat, Awesome!!!

  • @shanmugamn789
    @shanmugamn789 4 года назад +1

    If possible share Taints tolerance & node affinity video .

    • @justmeandopensource
      @justmeandopensource  4 года назад +1

      HI Shanmugam, thanks for watching this. I will do videos on those topics as well. Cheers.

  • @hwilliam77
    @hwilliam77 4 года назад +1

    May I know how to use a yaml file to create a deployment using PodNodeSelector? I tried adding namespace to the metadata in 1-nginx-deployment.yaml, but the pod status is always Pending.

    • @justmeandopensource
      @justmeandopensource  4 года назад +2

      Hi William, thanks for watching. The idea here is to automatically schedule the pod to a particular node. So you don't have to make any changes to the deployment manifest.
      The steps are (as shown in this video)
      1. Label the worker nodes
      2. Enable PodNodeSelector admission plugin in the cluster
      3. Add annotation to the namespace
      4. Deploy your deployments
      So whenever you deploy a pod to a namespace that has that annotation, it will select the worker node accordingly.
      I am not sure what you are trying to achieve, if you could explain in a bit more detail, it will help.
      Cheers.

    • @hwilliam77
      @hwilliam77 4 года назад +1

      Thank you for the reply.
      I am trying to deploy the deployment using yaml file instead of having to specify the parameter like image, replicas in the kubectl command.
      Like instead of running
      - kubectl -n dev run nginx --image nginx --replicas 4
      Could I run
      - kubectl -n dev create -f 1-nginx-deployment.yaml

    • @justmeandopensource
      @justmeandopensource  4 года назад +1

      @@hwilliam77 Yes you can. There are lots of such yaml examples in my github repo.

  • @brunof2547
    @brunof2547 3 года назад

    Hi Venkat, A short message to let you know that I managed to get this working last year on a Kubernetes 1.17.5 cluster installed with Kubespray, but it does not seeem to work anymore on 1.19.6 (installed with Kubespray as well). Even after restarting my nodes, when I describe the kube-apiserver pod, I see that the edit is not applied.

    • @brunof2547
      @brunof2547 3 года назад

      I finally got it working! The reason was I modified the /etc/kubernetes/kube-eapiserver.yaml with Ansible, that created a /etc/kubernetes/manifests/kube-apiserver.yaml.24448.2021-03-09@19:26:37~ backup of the original file, and the Kubelet was reading the backup! Strange but that was it.

  • @radhakrishnamoorthyp6734
    @radhakrishnamoorthyp6734 2 года назад

    Awesome man

  • @zhihaowang5410
    @zhihaowang5410 3 года назад

    Hi, How can I join the slack channel? I would like to join, thanks

  • @cahrlymca
    @cahrlymca 4 года назад

    Thanks for teaching K8S. So this topic is quite interesting.
    1. How could I enable PodNodeSelctor Plugin in Cloud Cluster like Google K8S Engine, EKS, AKS ?
    2. How could we create different spec nodes in Cloud clusters like One node in t2.micro and another in t2.example?

    • @justmeandopensource
      @justmeandopensource  4 года назад +1

      Hi Charly,
      Thanks for watching.
      Most of my videos were on self managed local k8s cluster. I haven't tried it in EKS yet. It seems it won't be possible to enable any admission control plugins on Cloud managed controller nodes.
      There is a discussion in the below threads about it.
      github.com/aws/containers-roadmap/issues/304
      stackoverflow.com/questions/51443535/aws-eks-enabling-admission-controllers
      And there seems to be an alternate way around it.
      github.com/liangrog/admission-webhook-server
      Cheers.

    • @cahrlymca
      @cahrlymca 4 года назад

      Hi Venkat,
      Thanks for your prompt reply. Understood your response.
      How can we create two different machine types in EKS cluster nodes?

    • @justmeandopensource
      @justmeandopensource  4 года назад +1

      @@cahrlymca You will have to create two nodegroups for that. Instances within a nodegroup will be of same type. For example you can create a nodegroup with 2 instances of t3.medium and another node group with 2 instances of m5.large. But you can't have different machine types in the same nodegroup.

    • @cahrlymca
      @cahrlymca 4 года назад

      @@justmeandopensource Thanks for detailing

    • @justmeandopensource
      @justmeandopensource  4 года назад

      @@cahrlymca You are welcome.

  • @MelliniNarumugai
    @MelliniNarumugai 4 года назад +2

    super... 😍 🔥 🔥 🔥

  • @richardwang3438
    @richardwang3438 4 года назад

    nice video! I am back