K8s Secret Env. Variables

ADD/CHANGE K8s SECRET ENV VARIABLES

  1. Make sure the env. proddeploymentuat
    Confirm if the pod is Green or Blue
  2. Open VSCode
  3. Select the cluster>configuration>secrets
  4. Select the one you want to change

    #Encrypting secrets is considered the best practice
  5. Use echo -n “xxxx” | base64   = this will encrypt the secret
  6. Copy and paste the encrypted one
  7. Use echo -n “xxxx” | base64 –-decode to reverse the encryption to see if it is correct
  8. Type kubectl config current-context   to see if you are in the correct path
  9. Save the folder
  10. Refresh the VSCode
  11. Type kubectl apply – f "name-of-file" to apply the changes to cluster
  12. DOUBLE CHECK THE ENV> prod – deploy – uat
    Select the correct Environment !!!
    Before killing the pod, check the Env. then Kill the pod and it will automatically restart ( If you have autoscale policy)
  13. Then > Shell into the pod
  14. Type printenv to see the environments within the pod
  15. Type printenv | grep “xxx” filter the changed/added information

Scroll to Top