From 46b65936828804ed3261df8b30a86d3c177f284c Mon Sep 17 00:00:00 2001 From: kasun Date: Mon, 23 Nov 2026 02:21:26 +0100 Subject: [PATCH] enhancement(k8s-infra): deploy through the control-plane VIP Deploys depended on master-1 being up. A fixed clusterIdentifier lets the provider move to the VIP as an update, because Pulumi otherwise treats a new API address as a different cluster and replaces every resource. The identifier was added to the stack state first so this change does not itself trigger a replacement. --- 03-k8s-infra/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/03-k8s-infra/index.ts b/03-k8s-infra/index.ts index d2fbd54..411e321 100644 --- a/03-k8s-infra/index.ts +++ b/03-k8s-infra/index.ts @@ -23,13 +23,13 @@ const domain = config.requireSecret("domain"); const longhornUiUser = config.requireSecret("longhornUiUser"); const longhornUiPassword = config.requireSecret("longhornUiPassword"); -// 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, -- 2.54.1