Does Kubeflow automatically trust the cluster's CA bundle for external HTTPS calls from pipeline components?
0 reputation · 12 Jul 2020, 12:52 UTC
0 reputation · 12 Jul 2020, 12:52 UTC
The goal is to determine whether a Kubeflow pipeline pod can validate TLS certificates of external HTTPS endpoints without manually adding the cluster’s root CA bundle to the container image.
Current behavior varies with the pod’s base OS, the presence of the SSL_CERT_FILE environment variable, and whether the kube-root-ca.crt volume mount is automatically applied, which differs between Kubeflow versions and ingress controllers such as Istio or NGINX.
Uncertainty remains about the default trust configuration and how DNS resolution interacts with certificate validation when external services are accessed.
Is the kube-root-ca.crt mount automatically added to all pipeline pods? Does the default SSL_CERT_FILE point to that mount when present? How does the trust behavior differ between Kubeflow v1.4 and v1.6?
34775 reputation · 12 Jul 2020, 15:51 UTC
No, Kubeflow Pipelines does not automatically expose the Kubernetes cluster’s CA bundle to pipeline component containers. By default each step trusts only the CA certificates baked into its base image.
/etc/ssl/certs/ca-certificates.crt (or the platform‑specific equivalent).requests, Go’s net/http, Node’s TLS stack) and the bundle is made available via SSL_CERT_FILE or the default path, external HTTPS calls will succeed.The trust store used by a component is determined by its runtime language and any environment variables such as SSL_CERT_FILE, REQUESTS_CA_BUNDLE, or Java’s javax.net.ssl.trustStore. Since the default launcher image does not mount the host’s CA bundle, those variables are unset, leaving only the image‑bundled certificates.
volumeMounts:
- name: host-ca
mountPath: /etc/ssl/certs/ca-certificates.crt
subPath: ca-certificates.crt
volumes:
- name: host-ca
hostPath:
path: /etc/ssl/certs/ca-certificates.crt
type: File
/etc/ssl/certs/ca-certificates.crt automatically; otherwise set an env var, e.g.:
env:
- name: SSL_CERT_FILE
value: /etc/ssl/certs/ca-certificates.crt
curl -v https://example.com (or an HTTP request in your language) to an external service whose leaf certificate is signed by the cluster’s CA.cat /etc/ssl/certs/ca-certificates.crt.Note: If your component uses a Java application with a custom keystore or an HTTP library that ignores the system trust store, simply mounting the bundle will not suffice; you must configure the library explicitly. Please let me know the language or HTTP client library used in your pipeline components if you need a more precise recommendation.
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 12 Jul 2020, 23:26 UTC
One clarification worth adding: the kube-root-ca.crt ConfigMap that Kubernetes (1.20+) publishes into every namespace contains only the cluster's own CA — the one used to verify the API server. Mounting it will not help validate certificates from external HTTPS endpoints signed by public CAs or a corporate root.
So even if you see that ConfigMap available in your pipeline pod's namespace, it solves a different problem (in-cluster API calls) than the one described here. For external endpoints you still need either the node's full CA bundle (as the answer above shows via hostPath) or a custom ConfigMap/Secret containing your organization's root CA, mounted and referenced via SSL_CERT_FILE.
Also note SSL_CERT_FILE is only honored by OpenSSL-based clients; Python's requests additionally respects REQUESTS_CA_BUNDLE, and Java ignores both. A quick verification inside a component container: python -c "import ssl; print(ssl.get_default_verify_paths())" shows exactly which file the runtime will trust.