I'm hoping to query a list of namespaces and popul...
# kubernetes
g
I'm hoping to query a list of namespaces and populate RoleBindings with those namespaces. Any ideas on how to implement? I found the
pulumi query
, but I'd like it to execute at
pulumi up
. I tried
pulumi query
anyways and I get some odd errors -
Copy code
pulumi query
Error: Program run without the Pulumi engine available; re-run using the `pulumi` CLI
g
Yeah, query was an experimental thing from a few years back, and doesn’t work as part of a normal Pulumi program. You could use the pulumi-command provider to run a
kubectl
command that returns the info you need formatted as JSON, and it should be fairly straightforward to parse the results. This requires the
kubectl
binary to be available wherever that pulumi program is running, but it’s quite flexible.
g
That's what I was gonna try next! Thanks. @gorgeous-egg-16927
👍 1
What if its during the pulumi github action?
I know i can install kubectl, but is it possible to get the pulumi action aware of kubectl if installed? if its dont in another step i think its gone?
f
pretty sure the workflow context keeps
kubectl
in between steps if you were to install it in a setup step
👍 1
and i ended up using this: https://github.com/Azure/setup-kubectl
1