Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Scheduling Pods with Taints and Tolerations in Kubernetes

In this hands-on lab, you will be presented with a three-node cluster. One node is the master, and the other two are worker nodes. You will be responsible for splitting up the two worker nodes and making one of the worker nodes a production (prod) environment node and the other a development (dev) environment node. The purpose of identifying these two types (prod and dev) is to not accidentally deploy pods into the production environment. You will use taints and tolerations to achieve this, and then you will deploy two pods: One pod will be scheduled to the dev environment, and one pod will be scheduled to the prod environment. When you have verified the two pods are up and running and they are located within the correct environments, you may consider this hands-on lab complete.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 20, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Taint one of the worker nodes to repel work.
    1. Use the following command to taint the node:
    kubectl taint node <node_name> node-type=prod:NoSchedule
    
  2. Challenge

    Schedule a pod to the dev environment.
    1. Use the following YAML to specify a pod that will be scheduled to the dev environment:

      apiVersion: v1
      kind: Pod
      metadata:
        name: dev-pod
        labels:
          app: busybox
      spec:
        containers:
        - name: dev
          image: busybox
          command: ['sh', '-c', 'echo Hello Kubernetes! && sleep 3600']
      
    
    1. Use the following command to create the pod:
    
      ```
      kubectl create -f dev-pod.yaml
      ```
    
  3. Challenge

    Allow a pod to be scheduled to the prod environment.
    1. Use the following YAML to create a deployment and a pod that will tolerate the prod environment:

      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: prod
      spec:
        replicas: 1
        selector:
          matchLabels:
            app: prod
        template:
          metadata:
            labels:
              app: prod
          spec:
            containers:
            - args:
              - sleep
              - "3600"
              image: busybox
              name: main
            tolerations:
            - key: node-type
              operator: Equal
              value: prod
              effect: NoSchedule
      
    2. Use the following command to create the pod:

      kubectl create -f prod-deployment.yaml
      
  4. Challenge

    Verify each pod has been scheduled and verify the toleration.
    1. Use the following command to verify the pods have been scheduled:

      kubectl get pods -o wide
      

    2.Scale up the deployment:

       kubectl scale deployment/prod --replicas=3
    
    1. Verify the toleration of the production pod:

      kubectl get pods <pod_name> -o yaml
      
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight