https://pulumi.com logo
Title
d

damp-honey-93158

10/05/2022, 2:36 PM
I’d like to know if its possible to use “create if not exists” semantics for a k8s secret using pulumi, has anyone done that?
g

gorgeous-egg-16927

10/05/2022, 3:51 PM
You’re looking for this 🙂
d

damp-honey-93158

10/05/2022, 6:56 PM
Thanks - I will take a look
I took a look, the upsert looks promising. It appears to do “insert if does not exist, update if it does exist” - which I guess is your typical upsert 🙂. Do you know if there is a way to do “insert if does not exist, otherwise do nothing”?
g

gorgeous-egg-16927

10/05/2022, 8:34 PM
I don’t know of a built-in way to do that, but you could write that logic either using the
pulumi-command
provider + kubectl, or with a language-specific k8s client library as part of your program.