https://pulumi.com logo
#pulumi-kubernetes-operator
Title
# pulumi-kubernetes-operator
b

bitter-carpenter-93554

09/15/2022, 11:40 PM
Hi! I am trying this example: https://github.com/pulumi/pulumi-kubernetes-operator/blob/master/examples/aws-s3/index.ts . I successfully created stack and I see 3 new buckets on S3. After that I deleted 1 S3 bucket. I expected that it will be recreated automatically, but it did not. Even if I run
pulumi up
the bucket is not created. What I am missing?
the only thing I found is this warning
so, in case of manual execution, I would run
pulumi refresh
and
pulumi up
to re-created deleted bucket
but how to achieve the same with pulumi operator ?
Copy code
const mystack = new k8s.apiextensions.CustomResource("stack3", {
    apiVersion: '<http://pulumi.com/v1|pulumi.com/v1>',
    kind: 'Stack',
    spec: {
        stack: stackName,
        projectRepo: stackProjectRepo,
        resyncFrequencySeconds: 60,
        refresh: true,
        //branch: "refs/heads/master",
        branch: "master",
        envRefs: { ...
b

brainy-beach-36627

09/16/2022, 8:24 AM
Hi ! In our case, we added
resyncFrequencySeconds: 240
. It will automatically refresh and update the stack every 240 seconds, even if no change is detected from git repo (https://github.com/pulumi/pulumi-kubernetes-operator/blob/master/docs/stacks.md)
b

bitter-carpenter-93554

09/16/2022, 3:59 PM
yes, I have this variable in my code
resyncFrequencySeconds: 60,
b

brainy-beach-36627

09/17/2022, 7:55 AM
My bad, I didn’t see you already had the variable in your Stack
b

bitter-carpenter-93554

09/19/2022, 9:42 PM
well, in mentioned pulumi example old operator version is used
Copy code
image: "pulumi/pulumi-kubernetes-operator:v1.0.0",
upgrading to 1.8.0 fixed the issue
@brainy-beach-36627 thank you for taking a look anyway)
e

eager-football-6317

09/29/2022, 9:29 AM
The operator does not do drift detection by default. You need to set the field
ContinueSyncOnCommitMatch
in the stack object; then it will run the stack, whether or not the commit or branch HEAD has changed.
8 Views