Hosted Control Plane and Proxy¶
Problem¶
In proxy environments, worker nodes of a hosted cluster route API server communication through the HTTP proxy. This causes failures because the connection between the worker nodes and the hosted control plane typically does not need (or cannot use) the proxy.
The first indicator is the service-ca-operator in namespace openshift-service-ca-operator not becoming ready.
| oc logs -f deployment/service-ca-operator -n openshift-service-ca-operator | |
|---|---|
Other symptoms include:
- Nodes not joining the cluster or reporting
NotReady - Pods failing to communicate with the API server
- Konnectivity or kubelet connectivity issues
Root cause¶
On HCP worker nodes, the static pod /etc/kubernetes/manifests/kube-apiserver-proxy.yaml handles the connection to the hosted control plane's API server:
- Without proxy:
kube-apiserver-proxyruns as a simple HAProxy that forwards traffic directly to the API server. - With proxy:
kube-apiserver-proxyacts as a reverse proxy that attempts to tunnel API traffic through the configured HTTP proxy.
Solution¶
Adding kubernetes to noProxy forces the rollout of HAProxy with a direct connection instead of routing the traffic through the proxy.
| HostedCluster spec.configuration.proxy | |
|---|---|
Warning
Always include kubernetes in noProxy when running a hosted cluster behind a proxy. Additionally include your cluster and service network CIDRs and any other endpoints that should be reached directly.
Manual workaround (deploy HAProxy as kube-apiserver-proxy): https://gist.github.com/rbo/d8fe1aee94c53355a6e7e502bfd1cdbf