ADD/CHANGE K8s SECRET ENV VARIABLES
- Make sure the env.
prod
–deployment
–uat
Confirm if the pod is Green or Blue - Open VSCode
- Select the cluster>configuration>secrets
- Select the one you want to change
–
#Encrypting secrets is considered the best practice
– - Use
echo -n “xxxx” | base64
= this will encrypt the secret - Copy and paste the encrypted one
- Use
echo -n “xxxx” | base64 –-decode
to reverse the encryption to see if it is correct - Type
kubectl config current-context
to see if you are in the correct path - Save the folder
- Refresh the VSCode
- Type
kubectl apply – f "name-of-file"
to apply the changes to cluster - 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) - Then > Shell into the pod
- Type printenv to see the environments within the pod
- Type
printenv | grep “xxx”
filter the changed/added information