https://pulumi.com logo
Title
s

stocky-sundown-45608

03/29/2023, 8:49 AM
I have a use case where in I am setting up k8s resources using helm chart and also creating a custom service account which would replace the service account added by helm for deploy/pods. I can set the pod service account using patch however I would like to do the patch only if service account is not replaced. To do that I would need to retrieve the existing pods service account and I don’t see any good way to do that in Pulumi, saw something with kubernete query but that was not maintained. I have currently worked around by setting a flag but I would like that to be dynamic so what’s the best way to retreive pod spec and service account
m

many-telephone-49025

03/29/2023, 2:05 PM
Hi @stocky-sundown-45608, have a look into the post rendere from Helm https://helm.sh/docs/topics/advanced/#post-rendering Which is also supported by Pulumi through
postRender
on the Release resource!
s

stocky-sundown-45608

03/30/2023, 6:29 AM
thank you will take a look at using postRender @many-telephone-49025
a

able-crayon-21563

04/09/2023, 10:03 PM
@stocky-sundown-45608, as @many-telephone-49025 mentioned, you can transform the helm output before its applied to the cluster. Another idea to consider is to use a Get Fun https://www.pulumi.com/docs/intro/concepts/resources/get/