diff --git a/04-k8s-apps/index.ts b/04-k8s-apps/index.ts index 8827752..4f6c94b 100644 --- a/04-k8s-apps/index.ts +++ b/04-k8s-apps/index.ts @@ -10,13 +10,13 @@ const bootstrapRef = new pulumi.StackReference( const kubeconfig = bootstrapRef.requireOutput("kubeconfig"); export const domain = config.requireSecret("domain"); -// Keep the kubeconfig stored in state. A changed API address would otherwise -// make Pulumi replace the provider and every resource in this stack. -const k8sProvider = new k8s.Provider( - "k3s", - { kubeconfig }, - { ignoreChanges: ["kubeconfig"] }, -); +// A fixed identifier makes kubeconfig changes (e.g. a new API address) provider +// updates. Without it, they replace the provider and every resource in this +// stack. Changing this value triggers that replacement, so never change it. +const k8sProvider = new k8s.Provider("k3s", { + kubeconfig, + clusterIdentifier: "homelab-k3s", +}); const opts = (extras?: pulumi.ResourceOptions): pulumi.ResourceOptions => ({ provider: k8sProvider, ...extras,