pulumi / pulumi-kubernetes-operator

A Kubernetes Operator that automates the deployment of Pulumi Stacks
Apache License 2.0
221 stars 55 forks source link

Run Automatically on OCIRepo Updates #392

Closed rawkode closed 1 year ago

rawkode commented 1 year ago

Hello!

Issue details

When using OCIRepo as a source, the operator should run updates whenever the OCIRepo has been updated.

When using a 5m sync on both OCIRepo and Stack, this can lead to 10m before Pulumi eventually runs the sync.

Affected area/feature

OCIRepo Source

squaremo commented 1 year ago

The operator should notice when a Flux source is updated, and queue Stacks that use it, after #348. Do you have evidence to suggest it's not working in this particular case (or in general!)?

For the OCIRepo, that's Flux's responsbility -- it's not clear to me from https://fluxcd.io/flux/components/notification/receiver/ whether you can set up a webhook receiver to poke an OCIRepo or not, but that's how you'd do better than polling.

rawkode commented 1 year ago

Does the status of the Stack get updated to queued and/or running?

Perhaps I'm just not getting enough information to know that my stack update is happening

squaremo commented 1 year ago

Does the status of the Stack get updated to queued and/or running?

The operator sets a condition Reconciling=True on the Stack object while it's running the stack (or if it failed a run and has requeued it to try again). Also: if you set the arg --zap-level=debug on the operator deployment you will get more in the logs about why it's running or not running a stack. It's a bit cryptic still but you may be able to interpret.

rawkode commented 1 year ago

@squaremo Could we have k get stacks show that it is queued and running too, please?

squaremo commented 1 year ago

Could we have k get stacks show that it is queued and running too, please?

Broadly, yes -- I agree that would be really useful.

There's no observable queued state, either the operator has seen it and it's running, or the operator hasn't seen it. There is a Reconciling=True (RetryingAfterFailure) condition that indicates it's been requeued, though.

I filed https://github.com/pulumi/pulumi-kubernetes-operator/issues/396 for improving the output of kubectl get stack in the way you're suggesting.

rawkode commented 1 year ago

Perfect. Thanks, @squaremo

pulumi-bot commented 1 year ago

Cannot close issue without required labels: resolution/

squaremo commented 1 year ago

I'm also happy to close this one (I'll sort out the labels to make pulumi-bot happy) -- do you want to make sure the operator works as expected with respect to OCIRepo objects, by looking at logs or conditions, though?

rawkode commented 1 year ago

I'll update my logging parameters and confirm, but I suspect this issue can be closed.

I can re-open if I can confirm the behaviour is broken.

Thanks for your help

squaremo commented 1 year ago

no-repro seems like the closest to "works for me" :-D