https://pulumi.com logo
#kubernetes
Title
# kubernetes
l

little-journalist-4778

09/24/2021, 12:23 PM
is it normal for ConfigMaps to being replaced if you change the content?
b

brave-ambulance-98491

09/24/2021, 3:49 PM
Yes, this is how Pulumi is designed. It's confusing, and the biggest gotcha in using the Kubernetes resources. Note that you can avoid delete-recreate if you let Pulumi name the resource, in which case it will create a new
ConfigMap
with a unique hashed name.
l

little-journalist-4778

09/27/2021, 8:15 AM
TY
r

rapid-soccer-18092

09/28/2021, 3:40 PM
You could use replaceOnChanges to force replacement of the resource when properties have changed - https://www.pulumi.com/blog/pulumi-release-notes-m58/#new-replaceonchanges-resource-option
However, I would like to know if this would correctly replace my configmap if only something in "Data" changed:
Copy code
var configMap = new ConfigMap("header-size-configmap",
                new ConfigMapArgs()
                {
                    Metadata = new ObjectMetaArgs()
                    {
                        Name = "nginx-chart-ingress-nginx-controller",
                        Namespace = "default"
                    },
                    Data =
                    {
                        ["large-client-header-buffers"] = "4 64k",
                    }
                },
                new CustomResourceOptions()
                {
                    ReplaceOnChanges = { "Data" }
                });
l

little-journalist-4778

09/29/2021, 10:17 AM
@rapid-soccer-18092 my question was the oppsite: why pulumi replaces the configmap if there are changes under data?
👍 1
r

rapid-soccer-18092

09/29/2021, 10:19 AM
Ah right - I got lost in the github issue and forget the context of your question 😉
26 Views