https://pulumi.com logo
#general
Title
# general
r

rich-whale-93740

10/10/2023, 8:28 PM
How to get the kubeconfig if the
aws
provider is used to create the eks cluster?
m

mysterious-activity-97749

10/10/2023, 9:04 PM
The https://www.pulumi.com/registry/packages/eks/ looks like it can export the kubeconfig easier than just the
aws
provider. I’ve used
aws eks update-kubeconfig --region region-code --name my-cluster
, assuming I had the AWS CLI setup in my environment. I may start using
pulumi-eks
instead for future projects 🤔. https://github.com/pulumi/pulumi-eks/blob/92b885d7bae98030ea1534c938b5e11818c35f3e/sdk/go/eks/cluster.go#L481 The
GetKubeconfig
func may have more insight to how
pulumi-eks
implements it.
r

rich-whale-93740

10/10/2023, 9:24 PM
Right unfortunately we are using the
aws
provider at the moment
s

salmon-leather-17096

10/10/2023, 10:07 PM
Not directly, we export necessary info (endpoint/CA data/name) and build it
r

rhythmic-megabyte-99595

10/11/2023, 3:13 PM
Hi @salmon-leather-17096, I built the kubeconfig and used it on
pulumi_kubernetes.apps.v1.Deployment
like this:
Copy code
k8s_provider = Kprovider("eksProvider", kubeconfig=kubeconfig_content)
deployment = Deployment(
...
opts=pulumi.ResourceOptions(providers=[aws_provider, k8s_provider]),
)
And I got this error:
Copy code
error: configured Kubernetes cluster is unreachable: unable to load schema information from the API server: the server has asked for the client to provide credentials
Did I miss anything?
8 Views