Skip to content

Support a custom SSL CA bundle for KubernetesHook connections - #71831

Open
dheerenmohta wants to merge 1 commit into
apache:mainfrom
dheerenmohta:kpo-ssl-ca-cert
Open

Support a custom SSL CA bundle for KubernetesHook connections#71831
dheerenmohta wants to merge 1 commit into
apache:mainfrom
dheerenmohta:kpo-ssl-ca-cert

Conversation

@dheerenmohta

@dheerenmohta dheerenmohta commented Aug 19, 2026

Copy link
Copy Markdown

KubernetesHook only offered a binary disable_verify_ssl switch, with no way to trust a custom or intermediate CA without disabling verification entirely. KubernetesExecutor's kube_client.py already solves this via a kubernetes_executor.ssl_ca_cert config key, so this mirrors that same capability into KubernetesHook (used by KubernetesPodOperator via its hook property), rather than inventing a new mechanism.

Adds ssl_ca_cert as a KubernetesHook constructor param and matching Connection-extra field, threaded through every get_conn() branch into the existing _TimeoutK8sApiClient choke point. Also documents the new field in the connections docs.

Known gap: AsyncKubernetesHook (deferrable/trigger path) doesn't apply disable_verify_ssl either today, so it isn't covered here — a pre-existing asymmetry, left as follow-up scope rather than guessed at.

closes: #53192


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Sonnet 5)

Generated-by: Claude Code (Sonnet 5) following the guidelines

KubernetesHook (which backs KubernetesPodOperator) could only fully
disable TLS verification via the "Disable verify SSL" connection
extra; there was no way to trust a cluster whose API server
certificate is signed by a custom or intermediate CA. Users hitting
this had to disable verification entirely just to let the operator
list/create/watch its spawned pods, weakening security for something
that only needed a CA bundle.

KubernetesExecutor's own client already supports this via the
kubernetes_executor.ssl_ca_cert config. Mirror the same capability
into KubernetesHook as a new ssl_ca_cert connection extra / hook
param, applied in _TimeoutK8sApiClient after config loading so it
can't be silently overwritten, consistent with how disable_verify_ssl
is already handled there.

closes: apache#53192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to specify ssl custom CA for operator pod using KubernetesPodOperator

1 participant