I have pod running my application. The pod also contains my secret. The secret mapped to /secret/mysecret.json
. I connecting to my pod with ssh and try to remove the secret from this pod instance:
rm /secret/mysecret.json
I getting the Error:
rm: cannot remove 'mysecret.json': Read-only file system
According to this article, I tried to changed the readOnly
settings to False
. No success.
Also tried to unmount it, got errors:
$ umount /secret/mysecret.json
umount: /app/secrets/app-specific: must be superuser to unmount
How I can delete secret from a pod?
You can not delete secret from pod as it is mapped as volume. Even if you managed to delete, it will be recreated. So if you want to remove secret from pod, change pod spec and delete that secret conf from spec itself.
The way you should handle this the kubernetes way is:
kubernetes delete secret <<secret name goes here>>