https://pulumi.com logo
#general
Title
# general
m

millions-judge-24978

07/03/2019, 3:25 AM
I am finding that a
k8s.apps.v1.StatefulSet
is being replaced when the diff is only to the
spec
, specifically adding
args
to one of the containers. This doesn't seem like it should be expected behavior right?
w

white-balloon-205

07/03/2019, 3:37 AM
The set of properties we treat at force replacement is here: https://github.com/pulumi/pulumi-kubernetes/blob/f1a6f90015ee7a2a316603308960c2a33b4db44e/pkg/provider/diff.go#L158 I believe the intention is that these match cases where Kubernetes does not support in place updates of the properties. Do any of those look wrong to you? Or are you not changing any of those?
m

millions-judge-24978

07/03/2019, 3:45 AM
It does not seem I am changing any of those:
Copy code
+-kubernetes:apps/v1:StatefulSet: (replace)
        [id=lightning/btcd-ltp0qgqg]
        [urn=urn:pulumi:main::lightning::kubernetes:apps/v1:StatefulSet::btcd]
        [provider=urn:pulumi:main::lightning::pulumi:providers:kubernetes::infrastructure::4ae1f6ee-c651-431e-ab0d-8123dd853a0e]
      ~ spec: {
          ~ template            : {
              ~ spec    : {
                  ~ containers: [
                      ~ [0]: {
                              ~ args           : [
                                  + [2]: "-rpcuser=lightning"
                                  + [3]: "-rpcpassword=lightning"
                                ]
                            }
                    ]
                }
            }
        }
h

helpful-advantage-49286

07/03/2019, 3:48 AM
You are, containerForceNewProperties includes args
m

millions-judge-24978

07/03/2019, 3:50 AM
It seems that should only apply for a
Pod
h

helpful-advantage-49286

07/03/2019, 4:15 AM
Isn’t a StatefulSet a Pod?
m

millions-judge-24978

07/03/2019, 4:20 AM
Well I certainly don't understand how this code works, maybe it is indeed causing
StatefulSet
replacement if
args
change. But I would expect that should not cause a replacement of the
StatefulSet
itself. The spec changes, and should in turn trigger a rolling deploy, replacing the individual pods one at a time, but not entirely replacing the stateful set. Doing that loses all of the stateful data and defies the whole point.
h

helpful-advantage-49286

07/03/2019, 4:22 AM
Is it actually replacing, or telling you it will?
I have definitely seen it say something will be replaced and then when run it is not.
Also, my understanding of a StatefulSet was that persistent volume claims were completely seperate
I’ve never played w/ them though!
m

millions-judge-24978

07/03/2019, 4:25 AM
It is actually replacing, and resulting in new PVC's.
g

gorgeous-egg-16927

07/03/2019, 5:33 PM
@millions-judge-24978 Can you file an issue? That may be an oversight with statefulsets since Pulumi’s typical workflow is to create a new instance of the resource and then delete the old one. I certainly wouldn’t expect it to use different PVCs.
m

millions-judge-24978

07/03/2019, 5:40 PM
Sure, what's odd is I swear this wasn't happening before, or I would have encountered it long ago, but I tried older versions to no avail. There's no chance this is related to auto-naming funkiness and not just due to an oversight on the diff code right?
g

gorgeous-egg-16927

07/03/2019, 5:52 PM
It could possibly be related to auto-naming, but I’d need to take a closer look to be sure. In general, it’s easier to just close out issues if it turns out to be nothing, so don’t hesitate to file if you see something weird.
m

millions-judge-24978

07/03/2019, 5:53 PM
👍
3 Views