https://pulumi.com logo
Title
a

aloof-dress-1001

08/04/2022, 4:43 PM
Hey guys, Im deploying an EKS cluster with pulumi_aws, and i want to connect my cluster to kubectl as soon as its deployed, how do i output the kubeconfig to my local machine inside the code and not by a command later on?
s

steep-toddler-94095

08/04/2022, 6:13 PM
i suppose you could run the
aws eks update-kubeconfig
command as bash inside your python code
a

aloof-dress-1001

08/04/2022, 6:24 PM
I did that, but i dont really like that solution because im too dependent on aws credentials. Is there any other way?
p

polite-napkin-90098

08/04/2022, 6:54 PM
https://www.pulumi.com/registry/packages/eks/api-docs/cluster/#kubeconfig_nodejs < the cluster object has an output of the kubeconfig, which you could write to a file I guess
s

steep-toddler-94095

08/04/2022, 7:04 PM
I did that, but i dont really like that solution because im too dependent on aws credentials. Is there any other way?
AWS auth to EKS is supposed to be dependent on your AWS credentials. It's a feature of EKS so that you don't need to create separate ServiceAccounts for users and all that. Having the Pulumi program automatically update the user's kube config with the same cluster admin credentials can be a security risk.
👍 2