11/11/2022, 1:08 AM
Hey 👋 QQ: can the pulumi kubernetes operator be defined in the same project (i.e. same nodejs package, sharing the same index.ts entrypoint etc.) as the resources it's controlling? Essentially controlling itself and applying it's own configuration, alongside the other deployments/services/resources etc. I understand that you define a stack that points at a git repository, but I'm building a monorepo and would prefer to code all my infra as code in one place, ideally one directory (i.e. /deploy or /infra for example). Is there a workable pattern for this?


11/11/2022, 11:49 AM
Yes, you can tie this knot 🙂 To bootstrap, you will need to do something like this: 1. define the infrastructure that the operator needs (i.e., a cluster); 2. define the operator installation, and a “root” Stack for it to apply; 3. in the root stack, define other Stacks as necessary to introduce apps etc. You can choose whether the root stack points to itself (or even to the stack in 1.), or just creates other stacks. The bit I’m not totally sure on is whether the operator is able to apply the deployment that runs itself — you may need to un-deadlock it by putting the annotation `` "true"`` on the operator deployment. This WIP guide is about using the operator with Flux, but since it discusses bootstrapping, it might help:


11/14/2022, 11:01 PM
yes, operator can apply its own configuration. But, I had to init my root/main stack manually first time.


12/05/2022, 10:31 PM
Yup, you have to bootstrap it, either by applying some YAMLs or running a Pulumi program by hand.