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

[BUG] set-kube-service-host-fqdn at odds with k8s docs #3183

Closed
olix0r opened this issue Sep 6, 2022 · 2 comments
Closed

[BUG] set-kube-service-host-fqdn at odds with k8s docs #3183

olix0r opened this issue Sep 6, 2022 · 2 comments
Labels

Comments

@olix0r
Copy link

olix0r commented Sep 6, 2022

AKS 2022-07-17 includes the following release notes:

The annotation kubernetes.azure.com/set-kube-service-host-fqdn can now be added to pods to set the KUBERNETES_SERVICE_HOST variable to the domain name of the API server instead of the in-cluster service IP. This is useful in cases where the cluster egress is via a layer 7 firewall, like Azure Firewall with Application Rules.

This feature is at odds with the documented Kubernetes client discovery behavior:

While running in a Pod, the Kubernetes apiserver is accessible via a Service named kubernetes in the default namespace. Therefore, Pods can use the kubernetes.default.svc hostname to query the API server. Official client libraries do this automatically.

While client-go currently maintains support for the legacy environment-based configuration, other clients do not, rendering them unable to work properly in clusters that use egress firewalls.

Ideally, AKS should support the documented client discovery rules instead of forcing clients to support the (now undocumented) legacy discovery behavior. Alternatively, the Kubernetes docs should be updated to describe the heuristics whereby the KUBERNETES_SERVICE_HOST env var should be honored.

See also linkerd/linkerd2#9339

@olix0r
Copy link
Author

olix0r commented Sep 6, 2022

Note also that client-go will sooner or later drop support for KUBERNETES_SERVICE_HOST, per https://github.com/kubernetes/client-go/blob/b8b620636cbbb3bf92696d3a9ba5efb7f60fe1f2/rest/config.go#L534-L540

@olix0r
Copy link
Author

olix0r commented Sep 8, 2022

I've submitted a kubernetes website PR to correct the documentation kubernetes/website#36691

@olix0r olix0r closed this as completed Sep 8, 2022
@Azure Azure locked as resolved and limited conversation to collaborators Oct 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant