I have a cronjob deployed. I need to update a parameter -- rotate an AES key -- contained in the secret. The secret is sops encrypted.
Is it possible to update the AES key without redeploying the job?
What I have tried:
"kubectl edit secret jobsecret" -- edits the sops encrypted file but it is still encrypted
"helm edit secrets jobsecret.yaml" -- edits/encrypts the parameter file before deploy
My next thought is to create a file, then encrypt it with sops and copy/paste the result into the editor for "kubectl edit secret jobsecret". I was hoping that there was a better way.
I am a developer, not a k8s admin. But, not by choice. Filling in until we can remedy the "no k8s admin" issue.
secret
in akey
:value
(value=aes_key) fashion you could try to use$ kubectl patch secret YOUR_SECRET -p '{"data":{"aes_key":"NEW_BASE64_ENCODED_VALUE"}}'
Have you tried this way? Could you show theYAML
definition of yourJob
and yourSecret
? Also please take a look on the official documentation aboutSecret
that are mounted asVolumes
(they are updated automatically): kubernetes.io/docs/concepts/configuration/secret/…