Repository navigation
feat(controller): let the module controller serve its admission webhooks - #237
Merged
Merged
Conversation
With webhookEnabled the module controller pod runs two Go processes: the controller and a "webhooks" container that serves a few validating handlers. On masters that is a container request per controller replica for handlers the controller binary can serve itself. Add webhooksInController (default false, used only with webhookEnabled). With it the webhooks container and its VPA policy are not rendered, and the controller container gets what the webhooks container had: - the "https" port (webhooksPort), which the webhook Service targets by name, rendered after the metrics port and before additionalControllerPorts; - the webhook certificate Secret mounted read-only at webhooksCertMountPath; - WEBHOOKS_BIND_ADDRESS=:<webhooksPort> and WEBHOOKS_CERT_DIR=<webhooksCertMountPath>, which the webhookserver package of sds-common-lib reads. The pod keeps the checksum/ca annotation and the webhook-certs volume. The controller has to serve the handlers there over TLS and report ready only once the listener is up, since pod readiness is what puts the pod behind the webhook Service. Modules that do not set the option render as before. Signed-off-by: v.oleynikov <vasily.oleynikov@flant.com>
krpsh123
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the
webhooksInControlleroption tohelm_lib_module_controller_manifests(defaultfalse, used only together withwebhookEnabled). With it:webhookscontainer and its VPA policy are not rendered;controllercontainer gets thehttpsport (webhooksPort, the port name the webhook Service targets), rendered after the metrics port and beforeadditionalControllerPorts;webhook-certsvolume, unchanged) is mounted read-only into the controller atwebhooksCertMountPath;WEBHOOKS_BIND_ADDRESS=:<webhooksPort>andWEBHOOKS_CERT_DIR=<webhooksCertMountPath>.The
checksum/caannotation and the volume stay.webhooksImageNameandwebhooksCommandare not used in this mode. Chart version 1.72.38.The controller side is the
webhookserverpackage of sds-common-lib: it reads the two variables, serves the module's existing handlers on a controller-runtime webhook server inside the manager and reports the pod ready only once the TLS listener is up.Why do we need it, and what problem does it solve?
Part of reducing the memory requests of the storage modules on master nodes. With
webhookEnabledevery controller pod runs a second Go process for a few validating handlers; on three masters that is one more container request per controller replica in every module (about 0.45 GiB of working set across the storage modules on a test cluster), for code the controller binary can serve itself.What is the expected result?
webhookEnabled: trueandwebhooksInController: truethe controller pod has one container; the webhook Service reaches the controller'shttpsport, and admission works as soon as the pod is Ready.Checklist