Using Kubernetes Services with DNS

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

Kubernetes Services can be located with the Kubernetes DNS just like Pods can. In this lab, you will work with the Kubernetes DNS to discover Services from within a Pod. This will test your knowledge of how to interact with Services using DNS.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Perform an Nslookup for a Service in the Same Namespace

Use the busybox Pod in the web namespace to perform an nslookup on the web-frontend Service. Use both the short Service name and its fully qualified domain name, and save all of the results to ~/dns_same_namespace_results.txt.

Perform an Nslookup for a Service in a Different Namespace

Use the busybox Pod in the web namespace to perform an nslookup on the user-db Service, which exists in the data namespace. Use both the short Service name and its fully qualified domain name, and save all of the results to ~/dns_different_namespace_results.txt.

Additional Resources

Your company, BeeBox, is working on evolving their Kubernetes application infrastructure. Currently, they have two application components in two different namespaces: a user database and a web frontend.

Your developers aren't quite sure how Kubernetes DNS works, and they are having trouble reaching some of their Services as a result. They have asked you to perform some tests that will help confirm and clarify for them how Kubernetes DNS behaves.

A Pod called busybox already exists in the web namespace. You can use this Pod to perform your tests. Save the output of your tests to some files, so that the developers can see the results.

What are Hands-on Labs

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.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?