New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to create loadbalancer in kubernetes :: Tags kubernetes.io/cluster/<id> missing on public subnet #1982
Comments
Same (or related) issue here: the tag % eksctl version |
It appears that the LoadBalancer creation failed because you did not tag your subnets. These tags are used by the cloud-controller-manager to determine the subnets to use for creating load balancers. Since you have specified a custom VPC (as opposed to letting eksctl create a dedicated VPC), you'll have to ensure the VPC and subnets meet the requirements documented here: https://eksctl.io/usage/vpc-networking/#use-existing-vpc-any-custom-configuration This is the intended behaviour and not a bug.
If a custom VPC is specified, eksctl does not modify any of its properties, including the tags on the subnets, so that tag might have been added externally. |
Did you supply a custom VPC? If you did, you'll have to add that tag to private subnets as eksctl does not tag/modify subnets if a custom VPC is specified. The full list of requirements for a custom VPC is documented here: https://eksctl.io/usage/vpc-networking/#use-existing-vpc-any-custom-configuration |
@cPu1 Indeed I use a custom VPC with both a set of private and public subnets specified. Apparently I remebered it wrong, I must have added the tag on older clusters. |
@cPu1 Thanks for the suggestions. As stated I was successful when I switched to EC2 node groups, which will have to be my method going forward until our next deployment effort in 2 weeks or so. When that happens I will read the guide and try to switch back to fargate and update this issue with my findings. I'm thinking that perhaps my unwanted tags on the private subnets were causing issues. |
Postmortem note for future travelers: |
I had an issue trying to create a Load Balancer in a cluster created with the config file below. I was using a VPC create with the Cloud Formation template for VPC in widdix (https://github.com/widdix/aws-cf-templates/blob/v11.4.0/vpc/vpc-2azs.yaml). It creates two public and two private subnets. I then use the two public subnets to create a config file below (obscured). I was unable to get a working load balancer (however using the same approach with an EC2 node group seems to work fine).
And this was how my service was being created in kubernetes (which is for a DJANGO rest api deployment)
The first thing I discovered is that the load balancer could not create (sorry message lost now). I solved that with the help of this comment.
kubernetes/kubernetes#29298 (comment) by tagging both my public subnet groups with kubernetes.io/cluster/ = owned. That allowed the load balancer to create. I also went to the Private subnets and saw that eksctl had added a kubernetes.io/cluster/ = shared on the private subnets. (perhaps from a previous attempt to build my cluster in the private subnets). So, somehow it seems as if eksctl has forgotten to apply the tag to the public subnets identified in my config yaml file.
Then my error became if I attempt to use the my-api-service I got a
Anything else we need to know?
What OS are you using, are you using a downloaded binary or did you compile eksctl, what type of AWS credentials are you using (i.e. default/named profile, MFA) - please don't include actual credentials though!
Versions
Please paste in the output of these commands:
$ uname -a
Linux ip-10-0-13-180.ec2.internal 4.14.173-137.228.amzn2.x86_64 #1 SMP Thu Mar 19 16:50:21 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ eksctl version
0.15.0
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.7-eks-1861c5", GitCommit:"1861c597586f84f1498a9f2151c78d8a6bf47814", GitTreeState:"clean", BuildDate:"2019-09-24T22:12:08Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.9-eks-502bfb", GitCommit:"502bfb383169b124d87848f89e17a04b9fc1f6f0", GitTreeState:"clean", BuildDate:"2020-02-07T01:31:02Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
Logs
Include the output of the command line when running eksctl. If possible, eksctl should be run with debug logs. For example:
eksctl get clusters -v 4
Make sure you redact any sensitive information before posting.
If the output is long, please consider a Gist.
The text was updated successfully, but these errors were encountered: