Which Kubernetes resources support immutable: true to prevent changes after creation?

Study for the Kubernetes Certified Network Administrator Exam. Our test offers comprehensive flashcards, multiple-choice questions, and detailed explanations. Be confident for your exam!

Multiple Choice

Which Kubernetes resources support immutable: true to prevent changes after creation?

Explanation:
Immutability in Kubernetes is about preventing in-place changes to certain objects after they’re created. For a resource to be immutable, you can set a flag (immutable: true) on it when you create it. Once that flag is set, updating the data of that object in place is not allowed; changes must be done by deleting and recreating the object (often with a new name) and then updating any references to point to the new one. ConfigMaps and Secrets are the resources that support immutable: true. This makes their data fixed after creation, which is particularly useful for protecting configuration data and sensitive information from accidental or unintended changes. If you need to update them, you create a new ConfigMap or Secret (often with a new name or version) and update the workload to use the new one. Other resource types like Deployments and StatefulSets, Pods, Nodes, Services, and Ingresses are designed to be updated and managed over time through changes to their specs or endpoints; they do not offer an immutable flag to lock their data in place.

Immutability in Kubernetes is about preventing in-place changes to certain objects after they’re created. For a resource to be immutable, you can set a flag (immutable: true) on it when you create it. Once that flag is set, updating the data of that object in place is not allowed; changes must be done by deleting and recreating the object (often with a new name) and then updating any references to point to the new one.

ConfigMaps and Secrets are the resources that support immutable: true. This makes their data fixed after creation, which is particularly useful for protecting configuration data and sensitive information from accidental or unintended changes. If you need to update them, you create a new ConfigMap or Secret (often with a new name or version) and update the workload to use the new one.

Other resource types like Deployments and StatefulSets, Pods, Nodes, Services, and Ingresses are designed to be updated and managed over time through changes to their specs or endpoints; they do not offer an immutable flag to lock their data in place.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy