3

I am creating 11 pods on EKS kubernetes. I have two public and two private subnets. In that, I have to move 10 pods in private subnet and 1 pod in public subnet. The reason behind moving in a public subnet is I have to attach public facing load balancer IP to it. But I have not sure how to move particular pod in particular subnet on EKS. I got similar question asked here. But. didn't got answer. All things I am creating via Cloudformation. How can I create particular pod in particular subnet on EKS?

1
  • Dennis Griesert's answer can fix issue. When node has network internface only in private subnets or public subnets. If my nodes have both public subnet and private subnet. How can I specific pod to private subnets ? Commented Mar 14, 2022 at 10:21

1 Answer 1

1

Seems like Kubernetes' nodeSelector is the thing you need. You just have to add a fitting label to the nodes, this answer will help you automate it.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Dennis. But how can attach a label to individual worker nodes. The link you provided attaching same label to all worker nodes. But I want attach label like if nodes in public subnet, I want to attach public label, if in private subnet , attach private as label.
You can get instance metadata as described here. Just add what reference you deem necessary (e.g. the subnet) to the user-data running on the instances.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.