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

busy-umbrella-36067

10/15/2018, 5:50 PM
@creamy-potato-29402 I need a
getCluster
function that provides the kubeconfig. which repo should I file the issue under?
c

creamy-potato-29402

10/15/2018, 5:54 PM
@busy-umbrella-36067 hmm not sure what you mean.. can’t you do something like:
Copy code
// Create an EKS cluster with the default configuration.
const cluster = new eks.Cluster("cluster");

// Export the cluster's kubeconfig.
export const kubeconfig = cluster.kubeconfig;
g

glamorous-printer-66548

10/15/2018, 6:29 PM
I think what @busy-umbrella-36067 means is something similar to this https://gist.github.com/geekflyer/b78adab2667d8526a1dd593bc5c844bf#file-gke-ts-L33-L66 to be made part of the eks package. I actually thought along the same lines for the gcp package.
b

busy-umbrella-36067

10/15/2018, 6:31 PM
@creamy-potato-29402 the eks cluster is created outside of pulumi
@glamorous-printer-66548 yup. I think AWS has an API call that will output the config for you, so you wouldn't even have to do much
g

glamorous-printer-66548

10/15/2018, 6:37 PM
@busy-umbrella-36067 i don’t see getting the kubectl config from either terraform or AWS’s API directly (checked the docs). Where do you get that info from? That being said i think pulumi could add it anyways.
I guess it might be awscli only
g

glamorous-printer-66548

10/15/2018, 6:38 PM
yep looks like, this is similar to
gcloud container clusters get-credentials
which generates a kubectl config but is also only part of the CLI
b

busy-umbrella-36067

10/15/2018, 6:39 PM
So pretty much exactly your gist @glamorous-printer-66548
For AWS
c

creamy-potato-29402

10/15/2018, 6:42 PM
@busy-umbrella-36067 ah. Got it. Can you file it against EKS repo itself?
✔️ 1
b

big-piano-35669

10/15/2018, 11:24 PM
I like this idea. In fact, it would be nice to try to achieve this for all flavors of hosted clusters. We had to do something dubious and questionable for GKE: https://github.com/pulumi/examples/blob/0cd79d7c10bd5198f13326d2660d84fbd60fa5ed/gcp-ts-gke/cluster.ts#L27