@@ -324,17 +324,27 @@ type ClusterTLSSpec struct {
324324 // +kubebuilder:default:=false
325325 // +optional
326326 Required bool `json:"required,omitempty"`
327- // ServerCertSecretRef is a reference to a TLS Secret containing the server certificate.
327+ // ServerCertSecret is a reference to a TLS Secret containing the server certificate.
328328 // It is expected that the Secret has the same structure as certificates generated by cert-manager,
329329 // with the certificate and private key stored under "tls.crt" and "tls.key" keys respectively.
330330 // +optional
331331 ServerCertSecret * corev1.LocalObjectReference `json:"serverCertSecret,omitempty"`
332- // CABundle is a reference to a TLS Secret containing the CA bundle.
333- // If empty and ServerCertSecret is specified, the CA bundle from certificate will be used.
334- // Otherwise, system trusted CA bundle will be used.
332+ // CABundle is a reference to a Secret key holding a CA bundle used to verify peer certificates.
333+ // If empty, the system trusted CA bundle is used.
335334 // Key is defaulted to "ca.crt" if not specified.
336335 // +optional
337- CABundle * SecretKeySelector `json:"caBundle,omitempty"`
336+ CABundle * CABundleSelector `json:"caBundle,omitempty"`
337+ }
338+
339+ // CABundleSelector selects a key holding a CA bundle from a Secret in the cluster's namespace.
340+ type CABundleSelector struct {
341+ // The name of the secret in the cluster's namespace to select from.
342+ // +kubebuilder:validation:Required
343+ Name string `json:"name,omitempty"`
344+ // The key of the secret to select from. Must be a valid secret key.
345+ // +kubebuilder:default:="ca.crt"
346+ // +optional
347+ Key string `json:"key,omitempty"`
338348}
339349
340350// Validate validates the ClusterTLSSpec configuration.
0 commit comments