https://pulumi.com logo
Title
l

limited-army-96747

02/09/2022, 8:03 PM
hey folks someone has some examples of how to use spot instances with eks? I am finding the docs to be a little confusing
b

bored-table-20691

02/09/2022, 8:08 PM
Are you having trouble on how to do it in general with EKS (separate from Pulumi), or how to do it with Pulumi?
l

limited-army-96747

02/09/2022, 8:08 PM
I already have deployed eks cluster with fargate pods using pulumi
now I want to deploy a couple of managed node groups using spot
b

bored-table-20691

02/09/2022, 8:54 PM
What’s the issue/confusion?
l

limited-army-96747

02/09/2022, 10:24 PM
because I used pulumi-kubernetes extension
it won’t accept my cluster , but the type seems the same
it seems to expect a `aws.eks.Cluster`type, but my type is only
Cluster
which is from pulumi-kubernetes
b

bored-table-20691

02/09/2022, 10:39 PM
what’s the full type of
eksCluster
? How did you create it?
l

limited-army-96747

02/09/2022, 10:40 PM
const eksCluster = new eks.Cluster(`eksCluster${pulumi.getStack()}`, {
  serviceRole: eksMasterRole...
b

bored-table-20691

02/09/2022, 10:48 PM
That doesn’t seem like the right repo -
pulumi-kubernetes
does not define it. It would be either from
pulumi-eks
or from
pulumi-aws
Given it’s
new eks.Cluster
, seems more likely the former.
https://www.pulumi.com/registry/packages/eks/api-docs/managednodegroup/#inputs note that the
cluster
is of type
CoreDataArgs
,not
eks.Cluster
In your code, instead of doing:
cluster: eksCluster
do:
cluster: eksCluster.core
l

limited-army-96747

02/09/2022, 10:58 PM
sweet
that worked
thanks, @bored-table-20691
b

bored-table-20691

02/09/2022, 10:59 PM
Glad it worked!