@@ -34,6 +34,7 @@ type APIServer struct {
3434 Status APIServerStatus `json:"status"`
3535}
3636
37+ // +openshift:validation:FeatureGateAwareXValidation:featureGate=TLSAdherence,rule="has(oldSelf.tlsAdherence) ? has(self.tlsAdherence) : true",message="tlsAdherence may not be removed once set"
3738type APIServerSpec struct {
3839 // servingCert is the TLS cert info for serving secure traffic. If not specified, operator managed certificates
3940 // will be used for serving secure traffic.
@@ -62,6 +63,39 @@ type APIServerSpec struct {
6263 // The current default is the Intermediate profile.
6364 // +optional
6465 TLSSecurityProfile * TLSSecurityProfile `json:"tlsSecurityProfile,omitempty"`
66+ // tlsAdherence controls if components in the cluster adhere to the TLS security profile
67+ // configured on this APIServer resource.
68+ //
69+ // Valid values are "LegacyAdheringComponentsOnly" and "StrictAllComponents".
70+ //
71+ // When set to "LegacyAdheringComponentsOnly", components that already honor the
72+ // cluster-wide TLS profile continue to do so. Components that do not already honor
73+ // it continue to use their individual TLS configurations.
74+ //
75+ // When set to "StrictAllComponents", all components must honor the configured TLS
76+ // profile unless they have a component-specific TLS configuration that overrides
77+ // it. This mode is recommended for security-conscious deployments and is required
78+ // for certain compliance frameworks.
79+ //
80+ // Note: Some components such as Kubelet and IngressController have their own
81+ // dedicated TLS configuration mechanisms via KubeletConfig and IngressController
82+ // CRs respectively. When these component-specific TLS configurations are set,
83+ // they take precedence over the cluster-wide tlsSecurityProfile. When not set,
84+ // these components fall back to the cluster-wide default.
85+ //
86+ // Components that encounter an unknown value for tlsAdherence should treat it
87+ // as "StrictAllComponents" and log a warning to ensure forward compatibility
88+ // while defaulting to the more secure behavior.
89+ //
90+ // This field is optional.
91+ // When omitted, this means the user has no opinion and the platform is left
92+ // to choose reasonable defaults. These defaults are subject to change over time.
93+ // The current default is LegacyAdheringComponentsOnly.
94+ //
95+ // Once set, this field may be changed to a different value, but may not be removed.
96+ // +openshift:enable:FeatureGate=TLSAdherence
97+ // +optional
98+ TLSAdherence TLSAdherencePolicy `json:"tlsAdherence,omitempty"`
6599 // audit specifies the settings for audit configuration to be applied to all OpenShift-provided
66100 // API servers in the cluster.
67101 // +optional
@@ -237,6 +271,35 @@ const (
237271type APIServerStatus struct {
238272}
239273
274+ // TLSAdherencePolicy defines which components adhere to the TLS security profile.
275+ // Implementors should use the ShouldHonorClusterTLSProfile helper function from library-go
276+ // rather than checking these values directly.
277+ // +kubebuilder:validation:Enum=LegacyAdheringComponentsOnly;StrictAllComponents
278+ type TLSAdherencePolicy string
279+
280+ const (
281+ // TLSAdherencePolicyNoOpinion represents an empty/unset value for tlsAdherence.
282+ // This value cannot be explicitly set and is only present when the field is omitted.
283+ // When the field is omitted, the cluster defaults to LegacyAdheringComponentsOnly
284+ // behavior. Components should treat this the same as LegacyAdheringComponentsOnly.
285+ TLSAdherencePolicyNoOpinion TLSAdherencePolicy = ""
286+
287+ // TLSAdherencePolicyLegacyAdheringComponentsOnly maintains backward-compatible behavior.
288+ // Components that already honor the cluster-wide TLS profile (such as kube-apiserver,
289+ // openshift-apiserver, oauth-apiserver, and others) continue to do so. Components that do
290+ // not already honor it continue to use their individual TLS configurations (e.g.,
291+ // IngressController.spec.tlsSecurityProfile, KubeletConfig.spec.tlsSecurityProfile,
292+ // or component defaults). No additional components are required to start honoring the
293+ // cluster-wide profile in this mode.
294+ TLSAdherencePolicyLegacyAdheringComponentsOnly TLSAdherencePolicy = "LegacyAdheringComponentsOnly"
295+
296+ // TLSAdherencePolicyStrictAllComponents means all components must honor the configured TLS
297+ // profile unless they have a component-specific TLS configuration that overrides it.
298+ // This mode is recommended for security-conscious deployments and is required
299+ // for certain compliance frameworks.
300+ TLSAdherencePolicyStrictAllComponents TLSAdherencePolicy = "StrictAllComponents"
301+ )
302+
240303// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
241304
242305// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
0 commit comments