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

rhythmic-ambulance-86976

03/03/2021, 4:38 PM
I'm trying to use the pulumi_eks module to stand up an eks cluster with fargate. According to https://www.pulumi.com/docs/reference/pkg/eks/cluster/#outputs I should be able to use eks_cluster.id to get the cluster name, but when I attempt to use that in creating a aws.eks.FargateProfile,
rbs_fargate_group = aws.eks.FargateProfile("rbs-infrastructure-fargate-profile",                                                                                        cluster_name=eks_cluster.id,
I get
TypeError: Missing required property 'cluster_name'
any ideas why? and I've tried using eks_cluster.name, but then I get
error: aws:eks/fargateProfile:FargateProfile resource 'rbs-infrastructure-fargate-profile' has a problem: Required attribute is not set
w

witty-candle-66007

03/03/2021, 4:53 PM
Does
eks_clsuter.core.cluster.name
work instead of
eks_cluster.id
?
r

rhythmic-ambulance-86976

03/03/2021, 5:13 PM
yes!
ok, one problem down, now on to why
provider =  k8s.Provider('k8s',
cluster = eks_cluster.core.cluster.name,
kubeconfig = f'{eks_cluster.kubeconfig}')
doesn't return the right cluster api address
w

witty-candle-66007

03/03/2021, 5:37 PM
Can you explain what you mean by that? Is it that
kubeconfig
is not set correctly?
r

rhythmic-ambulance-86976

03/03/2021, 7:21 PM
I'm trying to create namespaces, I got
error: configured Kubernetes cluster is unreachable: unable to load schema information from the API server: Get "<https://C520ECBD26B451221E89B36F176C3369.yl4.us-east-2.eks.amazonaws.com/openapi/v2?timeout=32s>": dial tcp: lookup <http://C520ECBD26B451221E89B36F176C3369.yl4.us-east-2.eks.amazonaws.com|C520ECBD26B451221E89B36F176C3369.yl4.us-east-2.eks.amazonaws.com> on 1.1.1.1:53: no such host
however right below that in the kubeconfig output I get
server                    : "<https://AB843D4EC07AB1FCE2EB8666BB2778B2.gr7.us-east-2.eks.amazonaws.com>"
so I'm not sure where it's getting the first API Server URL from
Well, I know when it existed. The previous cluster had that as its url, but then I destroyed the stack, rm'ed the stock, then initialized a new one
I've destroyed and rebuilt the stack several times today. Every time it gets to the create namespace task it picks up the URL from the previous instance of the stack
w

witty-candle-66007

03/03/2021, 7:27 PM
Can you try specifying only the kubeconfig file and not including the cluster name. Like this:
Copy code
provider =  k8s.Provider('k8s',
    kubeconfig = f'{eks_cluster.kubeconfig}')
r

rhythmic-ambulance-86976

03/03/2021, 8:53 PM
thanks! That got me past that problem. On to figuring out the next set of broken things. At least those are in k8s now and Pulumi is finally good 🙂
3 Views