Currenly when updating a kubernetes secrets file, in order to apply the changes, I need to run kubectl apply -f my-secrets.yaml
. If there was a running container, it would still be using the old secrets. In order to apply the new secrets on the running container, I currently run the command kubectl replace -f my-pod.yaml
. I was wondering if this is the best way to update a running container secret, or am I missing something.
Thanks.
kubectl edit secret <my secret> will (in my case) invoke vi. Now I move the cursor to the space after the colon of the secret I want to edit. Then I press r and [enter] which will put the base64 encoded value onto a line of its own.
A ConfigMap is an API object used to store non-confidential data in key-value pairs. Pods can consume ConfigMaps as environment variables, command-line arguments, or as configuration files in a volume.
For k8s' versions >v1.15: kubectl rollout restart deployment $deploymentname
: this will restart pods incrementally without causing downtime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With