Following <https://github.com/pulumi/pulumi-kubern...
# kubernetes
b
Following https://github.com/pulumi/pulumi-kubernetes/issues/1025 I was able to get
render_yaml_to_directory
to output YAML files from my Python code. However, I noticed (as documented) that this means I can’t then deploy those resources to the cluster with Pulumi as well. Does anyone have a pattern for doing both? ie. 1. run
pulumi up
2. deploy to cluster 3. generate YAML I tried: • Passing
providers
and a list of providers, but that didn’t seemed to revert to defaults • Using a config as a toggle between two providers, but this led to state problems • Abstracting the resources, and then applying twice in the same script, but Pulumi complains about them having the same name Appreciate this has a nice
BETA FEATURE
warning. I’d be interested if anyone has a pattern for doing the above, or if this might be supported in thee future.
:param pulumi.Input[str] render_yaml_to_directory: BETA FEATURE - If present, render resource manifests to this directory. In this mode, resources will not
be created on a Kubernetes cluster, but the rendered manifests will be kept in sync with changes
to the Pulumi program. This feature is in developer preview, and is disabled by default.
Note that some computed Outputs such as status fields will not be populated
since the resources are not created on a Kubernetes cluster. These Output values will remain undefined,
and may result in an error if they are referenced by other resources. Also note that any secret values
used in these resources will be rendered in plaintext to the resulting YAML.
b
Maybe @billowy-army-68599 can jump in here as I know he’s used the yaml_to_directory function
b
hey @brash-waiter-73733, great to see you here! the intent of the
renderYamlToDirectory
is to allow you to do your deployments out of band using one of the gitops methods. i haven't had time to create a demo of this yet, but generally I'd expect this to look like this - render yaml - use the github provider to push to a git repo - register the application in a gitops controller like argocd or flux i'm happy to jump on a call on Monday and chat through this if you liek
b
it works fine for that use case, I’ve got that working. I was looking for a way of being able to generate the files and deploy. Either in one run or via a setting of flag. I didn’t find a pattern that allowed me to do that.
b
no I don't think that exists, but i think it's a valid use case. would you mind adding an issue to pulumi/pulumi-kubernetes and we can have a look at it?
b