You will learn
📙
How to update a TLS certificate.Prerequisites
Audience: IT Professional
Difficulty: Intermediate
Time needed: Approximately 10 minutes
Tools required: If any
Updating a Certificate
Follow this section to change an existing TLS certificate, if desired.
*If the previous guides were followed, the TLS certificate will be named tf-tls. If a certificate was installed with a different name, replace tf-tls with the name being used.
Acquire a TLS certificate from a trusted provider.
Convert the certificate into base64 encoded PEM format. Follow vendor instructions for converting the current certificate to PEM, if it is not in the correct format.
Delete the existing TLS secret:
kubectl delete secret tf-tls
Run the following (replacing and with their respective paths):
kubectl create secret tls tf-tls --key <tls-key> --cert <tls-cert>
Set the Kong deployment name:
TF_KONG_DEPLOY=$(kubectl get deploy -l app.kubernetes.io/name=kong -o jsonpath='{.items[].metadata.name}')
Restart kong:
kubectl rollout restart deploy $TF_KONG_DEPLOY