From the course: Kubernetes Network and Cluster Hardening by Pearson

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Ingress security options

Ingress security options

In order to be able to create a TLS secret within Kubernetes, you have to know how to build a certificate and private key. Using the OpenSSL command within Linux, it's very easy to do. So here we're going to ask and create a new request. We're going to set up the value, so it's an X509 key. We're going to name it TLS.key, and then we're going to give it a subject of common name ingress.tls to be able to identify it. Now, when we create the actual secret itself, we use the kubectl create secret TLS, and then secret TLS with a certificate and key attributed to it. So this will allow me to be able to put that into the secrets within Kubernetes. Now, in order to be able to create this and then apply it, all we have to do is to be able to create the service itself. So here we're gonna create this simple rule. We're going to say anything that goes to foo.com with the URI bar is going to be connecting up to service 1, port 8080, and then using the TLS secret.TLS certificate. And as you can…

Contents