This message was deleted.
# general
s
This message was deleted.
g
The preview here is conservative; the k8s provider can’t tell if the cluster changes will cause resources to be replaced, so it previews a replace operation. For an upgrade, I wouldn’t expect the deployed resources to be replaced. If you separate the cluster update from the resource update, it will be able to give you a more definitive preview. There are a couple options for doing this: 1. Use the
--target
flag on
pulumi up
to update the cluster by itself. https://www.pulumi.com/docs/reference/cli/pulumi_up/ 2. Split the k8s cluster into a different stack than the k8s resources, and use StackReferences to decouple the operation.
c
thanks - i will try --target. Not sure what you mean re: 2, this is an existing cluster - wont this end up destroying my k8s resources if I remove them from the k8s stack?
ok - i see I have some reading to do re: StackReferences
g
It would take a bit of effort to move the cluster to a separate stack, but it is doable with changes to the stack state (not changing the actual deployed resources). Option 1 should be simpler, but would have to be done each time you want to upgrade.
c
I see. Fortunately I only have the one k8s resource managed my pulumi - the namespace. So I could delete this from the stack and manage it in another stack, that should be easier ?
g
Yes, that’s a good way to decouple those changes. You should be able to delete the Namespace from your stack state and then import it into a new stack. Here are a couple other references that may be helpful to you: https://www.pulumi.com/docs/intro/concepts/stack/#stackreferences https://www.pulumi.com/docs/guides/crosswalk/kubernetes/playbooks/
c
Thanks!