From 34691b9c4a1b76c359cd13aedce7695ed2855918 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Wed, 2 Sep 2020 13:21:21 +0200 Subject: [PATCH] Add info about immutable configmaps and secrets --- slides/k8s/configuration.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/slides/k8s/configuration.md b/slides/k8s/configuration.md index db5bbc09..3284e4a7 100644 --- a/slides/k8s/configuration.md +++ b/slides/k8s/configuration.md @@ -536,6 +536,8 @@ spec: --- +class: extra-details + ## Differences between configmaps and secrets - Secrets are base64-encoded when shown with `kubectl get secrets -o yaml` @@ -550,6 +552,29 @@ spec: (since they are two different kinds of resources) +--- + +class: extra-details + +## Immutable ConfigMaps and Secrets + +- Since Kubernetes 1.19, it is possible to mark a ConfigMap or Secret as *immutable* + + ```bash + kubectl patch configmap xyz --patch='{"immutable": true}' + ``` + +- This brings performance improvements when using lots of ConfigMaps and Secrets + + (lots = tens of thousands) + +- Once a ConfigMap or Secret has been marked as immutable: + + - its content cannot be changed anymore + - the `immutable` field can't be changed back either + - the only way to change it is to delete and re-create it + - Pods using it will have to be re-created as well + ??? :EN:- Managing application configuration