https://pulumi.com logo
d

dry-teacher-74595

08/19/2021, 9:04 PM
Hey im using EKS to create a cluster, and then creating a namespace and some secrets the general flow look something like this
Copy code
const cluster = new aws.eks.Cluster("cluster", {...})
     const namespace = new k8s.core.v1.Namespace("dev-namespace", {...})
    const secret = new k8s.core.v1.Secret("dev-secret", {...})
this works when im devleoping locally but when my CI pipeline tries to run
pulumi up
i get error like this
Copy code
error: configured Kubernetes cluster is unreachable: unable to load Kubernetes client configuration from kubeconfig file: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
can someone point me to some docs on what this KUBERNETES_MASTER environment variable is? or how to pass the cluster credentials from
new eks.Cluster()
to the
new k8s.Namespace()
call?
s

sparse-park-68967

08/19/2021, 9:21 PM
You will want to set the provider namespace/secret etc. to the provider from EKS. See https://github.com/pulumi/examples/blob/master/aws-ts-eks-hello-world/index.ts#L27 Sounds like the default kubernetes provider is trying to use ambient credentials (which probably don't exist) and failing.
b

billowy-army-68599

08/19/2021, 9:21 PM
Vivek beat me to it!
s

sparse-park-68967

08/19/2021, 9:24 PM
you're supposed to be resting @billowy-army-68599 😛
d

dry-teacher-74595

08/19/2021, 9:25 PM
ive seen that sample code but when i look at https://www.pulumi.com/docs/reference/pkg/aws/eks/cluster/ provider is not a output of new aws.eks.Cluster
oh i see it uses
@pulumi/eks
and not
@pulumi/aws
.eks what is the difference between the two?
ive changed the code to use @pulumi/eks but im getting an error
Copy code
error: Error: It looks like you're using AWS profiles. Please specify this profile in providerCredentialOpts.
        at new Cluster (/Users/peterzhang/workspace/formations/infra/node_modules/@pulumi/cluster.ts:1385:19)
however, ive already set the profile with
pulumi config set
and also running the command like this
Copy code
AWS_PROFILE=playground pulumi up
b
4 Views