openssl genrsa -out ca.key 2048
openssl req -x509 -new -nodes -key ca.key -days 10000 -out ca.crt -subj "/CN=example-ca"
openssl genrsa -out client.key 2048
openssl req -new -key client.key -out client.csr -subj "/CN=client1" -config openssl.cnf
openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -days 365 -extensions v3_req -extfile openssl.cnf
rm client1.csr
openssl verify -verbose -CAfile ca.crt client.crt
openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.p12 -passout pass:foo
openssl pkcs12 -in client.p12 -out client.pem -clcerts -passin pass:foo -passout pass:foo
(depends on kd)
export KUBE_NAMESPACE=my-namespace
export CA_CRT=$(base64 ca.crt)
export URL=myurl.tld.uk
export NAME=mydemo
kd -f secret.yml \
-f deployment.yml \
-f network-policy.yml \
-f service.yml \
-f ingress.yml
curl -v --cert client.crt --key client.key https://${URL}