How to get the kubeconfig if the `aws` provider is...
# general
r
How to get the kubeconfig if the
aws
provider is used to create the eks cluster?
m
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
Right unfortunately we are using the
aws
provider at the moment
s
Not directly, we export necessary info (endpoint/CA data/name) and build it
r
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?