Prerequisites

Many of the examples in this directory have common prerequisites.

TLS certificates

Unless otherwise mentioned, the TLS secret used in examples is a 2048 bit RSA key/cert pair with an arbitrarily chosen hostname, created as follows

$ openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt -subj "/CN=nginxsvc/O=nginxsvc"
Generating a 2048 bit RSA private key
................+++
................+++
writing new private key to 'tls.key'
-----

$ kubectl create secret tls tls-secret --key tls.key --cert tls.crt
secret "tls-secret" created

Note: If using CA Authentication, described below, you will need to sign the server certificate with the CA.

Client Certificate Authentication

CA Authentication also known as Mutual Authentication allows both the server and client to verify each others identity via a common CA.

We have a CA Certificate which we obtain usually from a Certificate Authority and use that to sign both our server certificate and client certificate. Then every time we want to access our backend, we must pass the client certificate.

These instructions are based on the following blog

Generate the CA Key and Certificate:

Generate the Server Key, and Certificate and Sign with the CA Certificate:

Generate the Client Key, and Certificate and Sign with the CA Certificate:

Once this is complete you can continue to follow the instructions here

Test HTTP Service

All examples that require a test HTTP Service use the standard http-svc pod, which you can deploy as follows

You can test that the HTTP Service works by exposing it temporarily

Last updated

Was this helpful?