Description
I noticed this after creating one ingress that worked fine, then creating another ingress which caused the first ingress to behave incorrectly (default backend 404, etc).
As far as I can tell, at least these resources and annotations are added to the ingress by GKE:
- ingress.kubernetes.io/forwarding-rule
- ingress.kubernetes.io/target-proxy
- ingress.kubernetes.io/url-map
If my namespace was called xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
(32 chars) and my ingress was named xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
, I'd see resources with names like:
k8s-um-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxx0
This is fine if there's only one ingress, but since my other ingress also started with the same set of characters, there would be a collision. I've looked at the resources/annotations it creates when using shorter names, and I notice that it means to append some random characters at the end. Here, it looks like I'm hitting the 64 character limit before it gets to that random string.
Maybe removing the 64 character limit or adding documentation about how these names are generated would help with this. It took me a while to look into this annotation as the root of my issues.
NOTE: This is the file that contains the naming logic https://github.com/kubernetes/ingress-gce/blob/master/pkg/utils/namer.go