Renewing Nginx SSL Certificate on Virtual Machine & Kubernetes Cluster

--

Virtual Machine

Steps

  1. Download the _.domain.zip file. And extract it.
  2. sudo cat 673492a50041aa56.crt gd_bundle-g2-g1.crt > domain.com.chained.crt
  3. Location /etc/nginx/ssl/ update the domain.com.chained.crt
  4. Restart the nginx sudo systemctl restart nginx.service
  5. Check the certificate date on the browser.

Kubernetes Cluster

  1. Download the _.domain.zip file. And extract it.
  2. sudo cat 673492a50041aa56.crt gd_bundle-g2-g1.crt > domain.com.chained.crt
  3. Convert the output into base64.
  4. Create domainsslsecret.yaml file kubectl get secret domain-tls -n default -oyaml > domainsslsecret.yaml
  5. Change tls.crt variable via new base64 value.
  6. Apply the domainsslsecret.yaml file in all namespace kubectl apply -f domainsslsecret.yaml -n default

Secret file- domainsslsecret.yaml

apiVersion: v1
data:
tls.crt: dfhkjdhfkjadshfdjjfdkjfdskjfbdsjkfsdakhfdksjhfkjdfasdjkhckhccksdhkhkfhsdakjhfdshj
tls.key: fdfakjhfjadkfhasdkjfhdsakjfhsdakjhfasdkjfhdskjfhdaskjbfdckjhaskdcasdkhccdschdsfdfs
kind: Secret
metadata:
name: domain-tls
namespace: default
type: kubernetes.io/tls

--

--

Neeraj Singh Negi

AWS | Openstack | GCP | Ansible | Redhat 8 Linux | Docker | Jenkins | Kubernetes | Hadoop | Python | Machine Learning