<@U019P3V40G4> did you try using the resource_pref...
# kubernetes
b
@many-psychiatrist-74327 did you try using the resource_prefix option? https://www.pulumi.com/docs/reference/pkg/kubernetes/yaml/configfile/#resource_prefix_pythob
if you share your code, I can give you an example - essentially you'd just prefix the resource with your cluster name.. something like this https://github.com/jaxxstorm/pulumi-examples/blob/master/python/kubernetes/helm-resource-prefix/__main__.py#L25
m
omg! no, I hadn’t seen that at all. i was basically implementing the same thing via transformations, but the renamings were not being respected (at the pulumi resource level), and i didn’t want to rename resources at the kubernetes level, because some resources are ServiceAccounts which are then referenced by name by other resources
i’ll try this out, thanks!
b
you can't transform the urn, that's why resource prefix exists 🙂
m
well, assuming the prefix only affects the pulumi urn, and not the underlying resource name, then this is exactly what i need. im trying it out, thanks!
b
it will also rename the resources with the prefix...
m
hm… that won’t work then 😞 i want to install the stuff in the yaml file in two (or more clusters), but i actually do want the installed resources to named the same way in each cluster. as in, let’s say the yaml defines a ServiceAccount, i dont want to end up with a ServiceAccount named
aws-service-account-1
in one cluster and
gcp-service-account-1
in the other.. especially since the Deployments, RoleBindings, etc., reference that ServiceAccount by name, and pulumi won’t be smart enough to rename those for me. I’m just using ServiceAccount as an example
it will also rename the resources with the prefix...
i just deployed it and the names of the k8s resources are intact, which is what i want 👍
b
👍
m
thank you! 🙏