You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow users to configure a CA bundle for the control plane connection on GatewayProxy.spec.provider.controlPlane, so that TLS certificate verification can be kept on when the control plane uses a self-signed certificate or a private/internal CA.
Background
GatewayProxy.spec.provider.controlPlane.tlsVerify controls whether the ingress controller (via the ADC executor) verifies the control plane's TLS certificate. We are moving this to a secure default (tlsVerify: true) in:
Review feedback (AlinsRan) on that PR raised a real gap: today there are effectively only two states available to users:
tlsVerify: false -> no verification (insecure)
tlsVerify: true -> verify against the system trust store only (works only if the control plane cert chains to a publicly trusted CA)
There is no way to supply a custom CA. So for the common case of a self-signed or private-CA control plane, a user who wants verification on has no path to make it succeed. Their only escape from the resulting connection error is to set tlsVerify: false, which risks turning the insecure opt-out into copy-paste boilerplate and defeats the point of the secure default.
The missing third state is:
tlsVerify: true+ a CA bundle -> verify against a CA the user explicitly trusts (the correct setup for self-signed / private CAs)
Problem
ControlPlaneProvider only exposes Mode, Endpoints, Service, TlsVerify, Auth:
api/v1alpha1/gatewayproxy_types.go (ControlPlaneProvider struct) - no CA field.
api/adc/types.go (Config struct) - only TlsVerify bool, no CA material.
internal/adc/client/executor.go (ADCServerOpts) - only TlsSkipVerify *bool is sent to the ADC server; there is no field to pass a CA certificate.
So the gap is end to end: CRD -> translator Config -> ADC request -> adc.
Proposed solution
Add an optional CA bundle to the control plane provider, supporting either an inline PEM or a reference to a Kubernetes Secret/ConfigMap:
// CaBundle is a PEM-encoded CA certificate (or bundle) used to verify the// control plane's TLS certificate. Takes precedence over the system trust// store. Only relevant when tlsVerify is true.// +optionalCaBundlestring`json:"caBundle,omitempty"`// Alternatively / additionally, a Secret/ConfigMap reference:// CaBundleRef *SecretKeySelector `json:"caBundleRef,omitempty"`
Then thread it through:
CRD - add the field(s) to ControlPlaneProvider in api/v1alpha1/gatewayproxy_types.go; regenerate CRDs (config/crd/bases, config/crd-nocel/...), deepcopy, and docs.
Translator - resolve the CA (inline value, or read the referenced Secret/ConfigMap the same way admin-key secrets and Gateway frontendValidation caCertificateRefs are resolved - see internal/adc/translator/gatewayproxy.go and internal/adc/translator/gateway.go) and set it on the ADC Config (api/adc/types.go).
Executor - carry the CA into the request sent to the ADC server (internal/adc/client/executor.go, ADCServerOpts).
Open questions / dependencies
ADC server support (blocker to confirm first). The ADC request today only carries tlsSkipVerify. Passing a CA end to end requires the adc server to accept and honor a CA bundle for the upstream Admin API connection. Confirm whether adc already supports this; if not, that side needs a companion change and this feature depends on it.
Source shape. Decide between inline PEM, a Secret/ConfigMap ref, or supporting both. There is prior art for resolving CA cert refs from Secret/ConfigMap in internal/adc/translator/gateway.go (frontendValidation caCertificateRefs) worth reusing for consistency.
Validation. Reject an invalid/unparseable PEM early (translator or webhook) with a clear status/condition rather than a late connection failure.
Interaction with tlsVerify. A CA bundle only makes sense when verification is on; document precedence (explicit CA bundle overrides the system trust store) and whether supplying a CA bundle while tlsVerify: false should warn.
Acceptance criteria
GatewayProxy can specify a CA bundle for the control plane (inline PEM and/or Secret/ConfigMap ref).
With tlsVerify: true + a valid CA bundle, the controller connects to a control plane using a cert signed by that CA (no tlsVerify: false needed).
Invalid CA material surfaces a clear error/condition, not a silent or opaque failure.
CRDs, deepcopy, and API reference docs regenerated; unit test covering the translator wiring (CA resolved and set on Config).
Summary
Allow users to configure a CA bundle for the control plane connection on
GatewayProxy.spec.provider.controlPlane, so that TLS certificate verification can be kept on when the control plane uses a self-signed certificate or a private/internal CA.Background
GatewayProxy.spec.provider.controlPlane.tlsVerifycontrols whether the ingress controller (via the ADC executor) verifies the control plane's TLS certificate. We are moving this to a secure default (tlsVerify: true) in:Review feedback (AlinsRan) on that PR raised a real gap: today there are effectively only two states available to users:
tlsVerify: false-> no verification (insecure)tlsVerify: true-> verify against the system trust store only (works only if the control plane cert chains to a publicly trusted CA)There is no way to supply a custom CA. So for the common case of a self-signed or private-CA control plane, a user who wants verification on has no path to make it succeed. Their only escape from the resulting connection error is to set
tlsVerify: false, which risks turning the insecure opt-out into copy-paste boilerplate and defeats the point of the secure default.The missing third state is:
tlsVerify: true+ a CA bundle -> verify against a CA the user explicitly trusts (the correct setup for self-signed / private CAs)Problem
ControlPlaneProvideronly exposesMode,Endpoints,Service,TlsVerify,Auth:api/v1alpha1/gatewayproxy_types.go(ControlPlaneProviderstruct) - no CA field.api/adc/types.go(Configstruct) - onlyTlsVerify bool, no CA material.internal/adc/client/executor.go(ADCServerOpts) - onlyTlsSkipVerify *boolis sent to the ADC server; there is no field to pass a CA certificate.So the gap is end to end: CRD -> translator
Config-> ADC request ->adc.Proposed solution
Add an optional CA bundle to the control plane provider, supporting either an inline PEM or a reference to a Kubernetes Secret/ConfigMap:
Then thread it through:
ControlPlaneProviderinapi/v1alpha1/gatewayproxy_types.go; regenerate CRDs (config/crd/bases,config/crd-nocel/...), deepcopy, and docs.frontendValidationcaCertificateRefs are resolved - seeinternal/adc/translator/gatewayproxy.goandinternal/adc/translator/gateway.go) and set it on the ADCConfig(api/adc/types.go).internal/adc/client/executor.go,ADCServerOpts).Open questions / dependencies
tlsSkipVerify. Passing a CA end to end requires theadcserver to accept and honor a CA bundle for the upstream Admin API connection. Confirm whetheradcalready supports this; if not, that side needs a companion change and this feature depends on it.internal/adc/translator/gateway.go(frontendValidationcaCertificateRefs) worth reusing for consistency.tlsVerify: falseshould warn.Acceptance criteria
GatewayProxycan specify a CA bundle for the control plane (inline PEM and/or Secret/ConfigMap ref).tlsVerify: true+ a valid CA bundle, the controller connects to a control plane using a cert signed by that CA (notlsVerify: falseneeded).Config).Related