is it normal for ConfigMaps to being replaced if y...
# kubernetes
l
is it normal for ConfigMaps to being replaced if you change the content?
b
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
TY
r
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
@rapid-soccer-18092 my question was the oppsite: why pulumi replaces the configmap if there are changes under data?
👍 1
r
Ah right - I got lost in the github issue and forget the context of your question 😉