hi room….python/eks question… im trying to create...
# kubernetes
p
hi room….python/eks question… im trying to create an EKS cluster with a nodegroup that uses spot instances. in trying to create my nodegroup :-
Copy code
eks_nodegroup = eks.NodeGroup("my-eks-nodegroup", opts=eks_opts, **eks_node_group_config)

File "/Users/bmeehan/repos/itplat-pulumi-infrastructure/venv/lib/python3.7/site-packages/pulumi_eks/node_group.py", line 145, in __init__
        raise TypeError("Missing required property 'cluster'")
    TypeError: Missing required property 'cluster'
however in trying to create my cluster it seems to need nodegroup to pre-exist :-
Copy code
# node_group_options: Optional[pulumi.Input[pulumi.InputType['ClusterNodeGroupOptionsArgs']]] = None,
so in my eks_cluster_config
"node_group_options": eks_node_group_config,
eks_cluster = eks.Cluster("myt-eks-cluster", opts=eks_opts, **eks_cluster_config)
so which should come first? chicken or egg ?
c
it's a bit difficult to follow the code blocks above... have you tried something like (untested):
Copy code
eks_cluster = Cluster(
  'name',
  node_group_options={
    min_size=0,
    max_size=0,
    desired_capacity=0
  },
  ...
)

ng1 = NodeGroup(
  'name',
  cluster=eks_cluster,
  ...
)
p
the issue i was facing is that i prebuilt a dict of the node_group_options and passed them in to the instantiation of both the nodegroup and the cluster
i have changed the code now to first create the cluster using the node_group_options_dict and then add the cluster reference to node_group_options_dict and then create the node_group