Documentation
¶
Index ¶
- func FetchAPIServerTLSProfile(ctx context.Context, c client.Client) (configv1.TLSProfileSpec, error)
- func GetTLSConfigFromProfile(profileSpec configv1.TLSProfileSpec) (func(*tls.Config), []string)
- func GetTLSProfileValues(ctx context.Context, c client.Client, tlsGroupsEnabled bool, ...) (minVersion, cipherSuites, curvePreferences string, ...)
- func NewSecurityProfileWatcher(initialProfile configv1.TLSProfileSpec, ...) *crcommon.SecurityProfileWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchAPIServerTLSProfile ¶
func FetchAPIServerTLSProfile(ctx context.Context, c client.Client) (configv1.TLSProfileSpec, error)
FetchAPIServerTLSProfile fetches the TLS profile spec from the cluster APIServer CR. This is a convenience wrapper around controller-runtime-common's function.
func GetTLSConfigFromProfile ¶
func GetTLSConfigFromProfile(profileSpec configv1.TLSProfileSpec) (func(*tls.Config), []string)
GetTLSConfigFromProfile returns a function that configures a tls.Config based on the provided TLS profile spec. The returned function is suitable for use with controller-runtime's metricsserver.Options TLSOpts field.
func GetTLSProfileValues ¶
func GetTLSProfileValues(ctx context.Context, c client.Client, tlsGroupsEnabled bool, previousObservedConfig map[string]interface{}) (minVersion, cipherSuites, curvePreferences string, observedConfig map[string]interface{}, err error)
GetTLSProfileValues fetches the cluster API Server TLS profile via library-go's ObserveTLSSecurityProfileWithGroupPaths and returns TLS_MIN_VERSION, TLS_CIPHER_SUITES, TLS_CURVE_PREFERENCES, and observedConfig for future comparisons to avoid unnecessary updates. Returns empty strings on error so callers fall back to kube-rbac-proxy defaults.
Curve preferences are only produced when tlsGroupsEnabled is true (the TLSGroupPreferences feature gate is enabled); otherwise an empty string is returned so callers leave curves unrestricted. The observer emits the (FIPS-filtered) group names, which are converted to numeric curve IDs for kube-rbac-proxy; unrecognized groups are warned-and-skipped rather than failing.
func NewSecurityProfileWatcher ¶
func NewSecurityProfileWatcher( initialProfile configv1.TLSProfileSpec, initialAdherence configv1.TLSAdherencePolicy, cancel context.CancelFunc, ) *crcommon.SecurityProfileWatcher
NewSecurityProfileWatcher creates a SecurityProfileWatcher that triggers graceful shutdown when TLS profile or adherence policy changes. The initial TLS profile spec and adherence policy are passed in so the watcher knows the baseline configuration from operator startup.
Types ¶
This section is empty.