Add TLS to a Kubernetes Service with Ingress

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

Ingresses make it easy to implement TLS for a Kubernetes Service. This lab will allow you to practice your skills with Kubernetes Ingress as you add TLS termination on top of an existing Service.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Generate Self-Signed Certificates for the Service and Store Them in a Secret

Create a self-signed certificate and key for the Service. Provide a subject of /CN=accounts.svc for the certificate and place it in /home/cloud_user/. Name the certificate accounts.crt and the key accounts.key.

Create an Ingress on Top of the Service That Configures TLS Termination

The accounts-svc can be found in the accounts namespace. Create an Ingress in that same namespace that configures TLS termination for the Service. Use the certificate and key that you generated earlier. The Service listens on port 80.

Additional Resources

Your company, SecuriCorp, is using Kubernetes to run a variety of applications. Recently, hackers have been trying various techniques to break into the Kubernetes cluster and steal data.

Your developers have built a Service called accounts-svc that provides user account data, but the Service itself uses an unencrypted HTTP protocol. This makes communications with that service vulnerable to various forms of attack.

Use an Ingress to implement TLS termination for the Service.

Note: The cluster does not have any Ingress controllers set up. However, for now, all you need to do is implement the Ingress configuration.

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?