kube icon indicating copy to clipboard operation
kube copied to clipboard

client: rustls is incompatible the env-based in-cluster config

Open olix0r opened this issue 3 years ago • 1 comments

As described in #1000, in-cluster Kubernetes clients must honor the KUBERNETES_SERVICE_HOST environment variable and cannot rely on this being identical to kubernetes.default.svc. Unfortunately, this value is usually an IP address, and webpki doesn't support IP address validation by IP (briansmith/webpki#54 rustls/webpki#4). Therefore, rustls cannot reliably be used with the default in-cluster configuration.

Once these upstream issues are addressed, the client Config documentation should be updated to remove caveats about rustls compatibility and CI changes (in #1001) should be reverted to test rustls in CI.

olix0r avatar Sep 09 '22 02:09 olix0r

This may be related to #991. I think that once that issue is done, kube-rs users may explicitly apply override tls-server-name = kubernetes.default.svc to the connection config, and verification will work in both in-cluster and external (because now server certificate will be validated against DNS name).

MikailBag avatar Sep 17 '22 14:09 MikailBag

As per 0.77.0, we now use @MikailBag 's idea of passing tls-server-name = kubernetes.default.svc by default for rustls and this should at least provide a better workaround for rustls.

clux avatar Dec 15 '22 15:12 clux