https://pulumi.com logo
#kubernetes
Title
# kubernetes
w

wet-noon-14291

02/26/2021, 10:30 PM
Has anyone an example of creation of a service account and then also generation of the kubeconfig for that service account? I know I can probably do it on the command line, but I would like to do it in pulumi but can't find the right methods to do it. Basically this but in pulumi: https://docs.armory.io/docs/armory-admin/manual-service-account/
b

billowy-army-68599

02/26/2021, 11:32 PM
you would need to use the kubernetes
.get
methods, but you might have a better time using the sdk
i can try put something together
when you create a service account, it creates an associated secret with a token in it
w

wet-noon-14291

02/27/2021, 8:39 AM
Which sdk are you referring to here? And which get methods? For context, I’m trying to set up some automation that creates service account and namespace for that service account. This would then be distributed to the team for the namespace and they can use it to deploy. I have azure ad integration as well, first thought was to use an azure service principal, but for azure as and rbac you need to login on a website everytime which won’t work in CI/CD setup, so I need service account and the config for it.
With
.get,
do you mean regular
kubectl get ...?
m

microscopic-orange-69417

03/04/2021, 3:41 AM
Very late to the party, but the cdk jaxxstorm was referring to is the kubernetes sdk here. One of the great things about Pulumi is you can just bring the SDK right into your module instead of having to do some custom script wrapping around tf or something!
w

wet-noon-14291

03/10/2021, 10:26 AM
awesome, will look into it.
Worked out like a charm 🙂. Haven't finished the flow, but have the puzzle pieces to create service account and the config for it in an automation job.
5 Views