I have a folder in my server that I want to update inside a cointaier in a pod. How do I do that without deleting the Secret?
I know that the following creates my secret:
oc create secret generic privkey --from-file=/opt/privkey
I know that the following deletes the secret:
oc delete secret generic privkey
Is there a way to do that without deleting? I am fine if I have to delete the pod.
Edit a Secret To edit the data in the Secret you created using a manifest, modify the data or stringData field in your manifest and apply the file to your cluster. You can edit an existing Secret object unless it is immutable. Kubernetes updates the existing Secret object.
If you update the secret, the change will propagate to all the pods that reference it (See the “Mounted Secrets are updated automatically” section of the guide on using secrets). This does require that your app re-read them after update (io-notify).
Secret data volumes are backed by temporary file-storage facilities (tmpfs) and never come to rest on a node. Secret data can be shared within a namespace.
try this:
oc create secret generic privkey --from-file=/opt/privkey --dry-run -o yaml | oc replace -f -
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