Sometimes you want to create configs/secrets for your applications, and you want to make sure when configs/secrets got created, nobody can change or update them. For example, you want to setup cloud credentials, your git token, database credentials, etc. and prevent any changes after being created in the Kubernetes cluster.
Kubernetes ConfigMap and Secret resources have a field called immutable which, if set to true, ensures that the data of ConfigMap/Secret cannot be updated after the resource is created. If any changes are needed, they should be created again.
After applying these resources, you get an error if you update them.
for: "configmap.yaml": error when patching "configmap.yaml": ConfigMap "test-immutable" is invalid: data: Forbidden: field is immutable when `immutable` is set
If you like this series of articles, please share them and write your thoughts as comments here. Your feedback encourages me to complete this massively planned program.