Source: Pieced this together myself
I always forget this.
In this example I install TLS certificates as Kubernetes secret resources into the ambassador
namespace.
First, gather your certificates. You will need two files:
- A PEM-encoded public key certificate (called
tls.crt
in this example) - The private key associated with given certificate (called
tls.key
in this example)
If a previous version of the certs already exist, delete them first.
In this example our secret is named ambassador-certs
.
kubectl -n ambassador delete secret ambassador-certs
Now we can use the kubectl create secret tls
command (yes, that whole thing is one particularly obscure command) to install the certificates into the ambassador
namespace:
kubectl -n ambassador create secret tls ambassador-certs --key ./tls.key --cert ./tls.crt