Has anyone an example of creation of a service acc...
# kubernetes
w
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
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
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
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
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.