Ingress TLS
Ingress TLS
Professional
VIDEOS
GUIDE
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.
Note: The cluster does not have any Ingress controllers set up. However, for now, all you
need to do is implement the Ingress configuration.
Solution
Log in to the control plane node server using the credentials provided:
ssh cloud_user@<PUBLIC_IP_ADDRESS>
Generate Self-Signed Certificates for the Service and Store Them in a Secret
vi accounts-tls-certs-secret.yml
15. To save and exit the file, press Escape and enter :wq.
16. Get a Base64-encoded version of the certificate:
base64 accounts.crt
vi accounts-tls-certs-secret.yml
19. Enter the command :set paste and i to enter insert mode.
20. Under tls.crt:, replace the placeholder text with the copied Base64-encoded string
output.
21. Press Escape and enter :wq.
22. Get a Base64-encoded version of the key:
base64 accounts.key
vi accounts-tls-certs-secret.yml
25. Enter the command :set paste and i to enter insert mode.
26. Under tls.key:, replace the placeholder text with the copied Base64-encoded string
output.
27. Press Escape and enter :wq.
28. Create the Secret:
vi accounts-tls-ingress.yml
loud_user@k8s-control:~$ history
2 openssl req -nodes -new -x509 -keyout accounts.key -out accounts.crt -subj "/CN=accounts.svc"
3 base64 accounts.crt
4 base64 accounts.key
5 vi secret.yml
7 vi secret2.yml
9 vi ingress.yml
10 kubectl create -f ingress.yml
12 history