Skip to content
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

workaround: cluster->lb traffic w/ TLS/ProxyProto #206

Closed
wants to merge 1 commit into from

Conversation

jcodybaker
Copy link

This PR excludes traffic with Layer7 rules from a kube-proxy optimization.
The kube-proxy optimization intercepts and redirects cluster egress traffic
destined for the LB to the backing services, avoiding the DigitalOcean LB
entirely. If the DO LB is providing L7 services like TLS termination, Proxy
Protocol, or StickySessions this breaks access to LB-hosted services
from within the cluster. This PR opts out of the optimization by returning
the IP address in the Hostname field rather than IP. The IP will be reported
to the user in the same way via tools like kubectl, but is interpreted differently
by kube-proxy.

kubernetes/kubernetes#66607

This PR excludes traffic with Layer7 rules from a kube-proxy optimization.
The kube-proxy optimization intercepts and redirects cluster egress traffic
destined for the LB to the backing services, avoiding the DigitalOcean LB
entirely.  If the DO LB is providing L7 services like TLS termination, Proxy
Protocol, or StickySessions this breaks access to LB-hosted services
from within the cluster. This PR opts out of the optimization by returning
the IP address in the Hostname field rather than IP.  The IP will be reported
to the user in the same way via tools like kubectl, but is interpreted differently
by kube-proxy.
@jcodybaker
Copy link
Author

jcodybaker commented Apr 3, 2019

This doesn't work because there's validation to explicitly prevent this:
service_controller.go:353] Failed to persist updated LoadBalancerStatus to service 'default/server' after creating its load balancer: Service "server" is invalid: status.loadBalancer.ingress[0].hostname: Invalid value: "178.128.134.186": must be a DNS name, not an IP address
https://github.com/kubernetes/kubernetes/blob/v1.13.5/pkg/apis/core/validation/validation.go#L5316-L5334

			if isIP := (net.ParseIP(ingress.Hostname) != nil); isIP {
				allErrs = append(allErrs, field.Invalid(idxPath.Child("hostname"), ingress.Hostname, "must be a DNS name, not an IP address"))
			}```

@jcodybaker jcodybaker closed this Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant