microscopic-cpu-38113
12/15/2022, 8:38 AMancient-policeman-24615
12/15/2022, 1:36 PMpulumi.all
should have no effect on if a resource needs to be updated/replaced. If you could show some example code, I’d be happy to help diagnose the problem, or escalate to someone more familiar with the area.microscopic-cpu-38113
12/15/2022, 2:31 PMconst dNSRecordSet = new GoogleDnsRecordSetComponent('app', {
gcpProjectName: props.gcpProjectName,
},{
parent: this,
});
const appConfig = pulumi
.all([
dNSRecordSet.cdnAddress,
])
.apply(
([
cdnAddress,
]) =>
JSON.stringify({
key: {
value1: cdnAddress,
value2: String(new Date().getTime()),
}
})
);
const jobConfigmapData = {};
jobConfigmapData[`config.${props.environment}.json`] = appConfig;
const jobConfigmap = new k8s.core.v1.ConfigMap(
'job-configmap',
{
metadata: {
namespace: props.namespace,
},
data: jobConfigmapData,
},
{
parent: this,
provider: props.clusterProvider,
deleteBeforeReplace: false,
}
);
something like this, I think the problem is the data is depending on the current date time, each time when Pulumi run the plan, the configmap data will then be updated. I thought configmap data can be updated on the fly in Kubernetes without deleting and recreating itancient-policeman-24615
12/15/2022, 3:15 PMappConfig
depends on the current time, then everything that depends on it will require an update each time you run pulumi up
. Its up to k8s.core.v1.ConfigMap
to decide if that change can be done in place (update) or needs a replacement.
P.S. From the example you have, you don’t need the pulumi.all
. You can just apply on the dNSRecordSet.cdnAddress
.microscopic-cpu-38113
12/15/2022, 3:22 PMancient-policeman-24615
12/15/2022, 3:23 PM<https://www.pulumi.com/registry/packages/kubernetes/api-docs/provider/#enableconfigmapmutable_yaml|enableConfigMapMutable>
.microscopic-cpu-38113
12/15/2022, 3:29 PMancient-policeman-24615
12/15/2022, 3:30 PMmicroscopic-cpu-38113
12/15/2022, 3:33 PMbillowy-army-68599
12/15/2022, 3:51 PMmicroscopic-cpu-38113
12/15/2022, 3:53 PMbillowy-army-68599
12/15/2022, 3:54 PMPulumi would think that there’s a change in the data of the configmap and it always delete the old configmap and create a new onei’d like to see what Pulumi thinks is changing. If the data is changing, it will obviously replace the config map
microscopic-cpu-38113
12/15/2022, 3:57 PM~ data: {
~ config.staging.json: (json) {
~ key: {
value*****: "34.*****60.84.6"
~ value2: "*****67***************[38;5;*****m8005567" => "*****67***************9766826"
}
}
}
@ previewing update....
some of the value is masked but basically they are just timestampbillowy-army-68599
12/15/2022, 3:59 PMenableConfigMapMutable
option, now I understandmicroscopic-cpu-38113
12/15/2022, 4:01 PM