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

Creating a Service and Discovering DNS Names in Kubernetes

In this hands-on lab, you will be presented with a three-node cluster. You will be creating a simple nginx deployment, in which you must create a service from that deployment. In order to accomplish this, you will use the kubectl command line to create the deployment. Then, you will expose the deployment to create the service. When you have verified the service is up and running, you will create a busybox pod to test the DNS resolution to that service.

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

Contact sales

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

    Create an nginx deployment, and verify it was successful.
    1. Use this command to create an nginx deployment:

      kubectl run nginx --image=nginx
      
    2. Use this command to verify deployment was successful:

      kubectl get deployments
      
  2. Challenge

    Create a service, and verify the service was successful.
    1. Use this command to create a service:

      kubectl expose deployment nginx --port 80 --type NodePort
      
    2. Use this command to verify the service was created:

      kubectl get services
      
  3. Challenge

    Create a pod that will allow you to query DNS, and verify it’s been created.
    1. Use the following YAML to create the busybox pod spec:

      apiVersion: v1
      kind: Pod
      metadata:
        name: busybox
      spec:
        containers:
        - image: busybox:1.28.4
          command:
            - sleep
            - "3600"
          name: busybox
        restartPolicy: Always
      
    2. Use the following command to create the busybox pod:

      kubectl create -f busybox.yaml
      
    3. Use the following command to verify the pod was created successfully:

      kubectl get pods
      
  4. Challenge

    Perform a DNS query to the service.
    1. Use the following command to query the DNS name of the nginx service:

      kubectl exec busybox -- nslookup nginx
      
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