Service management module (shturval-services)

About the service

ParameterDescription
GUI nameService management module
System name (identifier)shturval-services
Cluster AssignmentOrchestration of installation and update of platform services: responds to ShturvalServiceConfig (SSC) and ShturvalServicePatch (SSP), deploys and updates Helm releases. Not intended for deploying custom applications (Argo CD, shturval-cd are used for this).
CriticalYes
Public repository— (component of the Shturval platform, based on Helm and Flux)
Dependenciesshturval-services-crds, shturval-networking
Namespaceshturval-services-system

Contents

  1. Review
  2. Architecture
  3. Lifecycle
  4. Diagnostics
  5. Installation/deployment
  6. Operator parameters
  7. CRD/API reference

1. Review

Purpose: the operator automates the installation, update, rollback and removal of Helm charts in the cluster for objects ShturvalRepoConfig, ShturvalServiceConfig and ShturvalServicePatch. Area of responsibility is registration of Helm repositories in the Helm runtime engine inside the operator Pod, coordination of releases (install / upgrade / rollback / uninstall), checking manifest drift and health of resources marked as managed by Helm.

How the module works with resources

The operator manages three cluster-scoped CRDs in the ops.shturval.tech group:

ResourceRole
ShturvalRepoConfigDescribes a Helm repository (URL, credentials) for the engine in the operator Pod
ShturvalServiceConfig (SSC)Describes one Helm release: chart, version, namespace, repository (spec.reponame), mode and base customvalues
ShturvalServicePatch (SSP)Overrides mode and/or customValues for the selected SSC without directly editing the SSC

Administrator chain: ShturvalRepoConfig → ShturvalServiceConfig → Helm release in the target namespace. SSP references SSC via spec.shturvalServiceConfigName and is applied during SSC reconciliation, not via a separate Helm call from the SSP controller.

The ShturvalServicePatch controller does not install a Helm release. It links SSP to the target SSC (Accepted, ownerReference, label ops.shturval.tech/ssc). Merging mode and customValues happens during ShturvalServiceConfig reconciliation (see §3 — the Apply SSP patches block). Final values are written to status.appliedCustomValues, mode to status.appliedMode, and applied patch names to status.appliedPatches. The Applied condition on SSP is set when the SSP name appears in ssc.status.appliedPatches.

Features

ComponentPurposeOperation Notes
Registration of repositories (ShturvalRepoConfig)Adding/removing Helm repository entries in runtimeOperations with the repository file in the Pod are serialized (mutex), reconciliation is idempotent
Service reconciliation (ShturvalServiceConfig)Install/upgrade/rollback/uninstall release, modes auto / manual / absent, drift and healthDependencies between SSCs, processing stuck releases, finalizers; on reconcile — SSP merge and writing appliedCustomValues
Patches (ShturvalServicePatch)Override mode and customValues over SSCCommunication with SSC via ownerReference; order by patchOrder; actual application — in SSC reconcile
Mutating webhook for ShturvalServiceConfigSync spec.serviceclass to label shturval.tech/classRequires working TLS for webhook (see Limitations)
Validating webhook for ShturvalServiceConfigReservedValidation logic not implemented (stub); see Limitations
Health Check Engine (GitOpsEngine)Checking the health and drift of release resourcesObjects with the label app.kubernetes.io/managed-by are taken into account

Initiation scripts

What’s going onWho initiatesObserved effect
Repository reconciliationControl plane (events ShturvalRepoConfig)Update status, register the repository in the Helm engine in Pod
Service reconciliationControl plane (events ShturvalServiceConfig and related SSPs)SSP merge, changing the Helm release in the target namespace, updating appliedCustomValues / appliedMode / appliedPatches and conditions in status
Patch reconciliationControl plane (SSP events and SSC appliedPatches changes)OwnerReference, labels, conditions Accepted / Applied
Mutating webhookAPI server when Create/Update ShturvalServiceConfigInstalling/updating service class label
Validating webhookAPI server when Create/Update ShturvalServiceConfigWithout validated business logic validation
Background Health CheckStarting the operator processEngine readiness for drift/health checks

Limitations and implications

LimitConsequence
TLS for webhooks expected via cert-managerWithout a configured mechanism for issuing certificates, webhooks will not be put into operation
ShturvalServiceConfig with name shturval-services is processed with write-lock and a delay of 1 minute after unlockingWhen such an SSC changes, other SSC reconciliations may wait up to ~1 minute
spec.iscritical: true prohibits deletion in absent modeBefore removing the release, it is necessary to remove the criticality in the specification
TLS client authentication for Helm repository (fields like cert/key/ca for repo) not supported in APIAuthentication — using credentials and the insecure flag within the framework of the described ShturvalRepoConfig
MaxHistory in Helm logic is fixed (value 2 in operator delivery)A limited number of revisions are available for rollbacks; change requires a new version of the image
Validating webhook for SSC — no validation implementedErrors in spec SSC at the admission level are not caught by this webhook
Metrics are disabled by default (--metrics-bind-address=0)Collecting metrics from a process will require explicit configuration in the deployment manifest
HTTP/2 is disabled by default for metrics and webhook serversBehavior when integrating with external proxies — consider settings

Place in the chain of command

The diagram below is the chain Helm repository / CRD / operator / Helm release and the points where webhook and reconciliation intervene (objects ShturvalServiceConfig and ShturvalServicePatch in the Kubernetes API, releases and resources in the data plane).

Illustration: Place in the chain of command

Management chain: repository, release, patch, webhooks

Key Features

CharacteristicsDescription
API Groupops.shturval.tech
API Versionsv1beta1 (spoke), v1beta2 (hub, storage)
Typical deployment namespace (Kustomize / Helm)shturval-services-system
Leader electionDefault off
MetricsDefault disabled
WebhookMutating + Validating for ShturvalServiceConfig (v1beta2); the delivery also includes a template for RepoConfig
SSC reconciliation concurrencyUp to 5 simultaneous reconciles (value supplied with the controller)
Panic behavior in SSC controllerrecover panic enabled

Components in a cluster

ComponentType KubernetesScopePurpose
ShturvalRepoConfigCRDClusterHelm repository (URL, credentials)
ShturvalServiceConfigCRDClusterParameters for one Helm release
ShturvalServicePatchCRDClusterPatch mode/customValues for the selected SSC
Pod operatorDeploymentNamespacedProcess in typical namespace shturval-services-system
MutatingWebhook (SSC)MutatingWebhookConfigurationClusterSync class to label
ValidatingWebhook (SSC)ValidatingWebhookConfigurationClusterWithout validation business logic

2. Architecture

The inclusion and life cycle of the controller in the cluster is provided by cluster-manager (platform service); ShturvalServiceConfig (SSC) objects for associated charts are created and maintained as part of the platform configuration, rather than as an arbitrary manual installation of a Helm chart by an administrator.

Helm delivery (names from Chart.yaml)

The module comes with two separate Helm charts (not to be confused with CRD ShturvalServiceConfig / “SSC” in the API):

Chart name (Helm name)Catalog in sourcePurpose
shturval-services-crdshelm/crdsSetting CRD (ShturvalRepoConfig, ShturvalServiceConfig, ShturvalServicePatch)
shturval-serviceshelm/mainOperator deployment: Deployment, RBAC, webhook, services

The inclusion and life cycle of the controller in the cluster is provided by cluster-manager (platform service); ShturvalServiceConfig (SSC) objects for associated charts are created and maintained as part of the platform configuration, rather than as an arbitrary manual installation of a Helm chart by an administrator.

Operator Role

The operator is deployed as one Deployment in the namespace of platform services. The repository file and Helm cache are stored inside the Pod (paths are specified by process arguments, typically a directory in the image). Controllers access the Kubernetes API and the Helm engine; health/drift subsystem uses gitops-engine and monitors objects with the label app.kubernetes.io/managed-by.

Note: without the described TLS mechanism for webhooks, a production deployment with webhooks enabled will not match the expected configuration.

Workload components (Deployment, RBAC, webhook)
ElementDescription
Operator ContainerBinary shturval-operator, health/readiness probes at the address specified by the flag (typically :8081)
Roles and bindingsClusterRole/Binding for working with CRD and cluster operations according to the supplied manifests
WebhookService and TLS (via cert-manager in standard delivery) for mutating/validating
cert-managerExpected in the cluster to issue webhook certificates (see Limitations)

Communication with external systems

System/objectRole
HTTP(S) Helm repositoriesChart source by ShturvalRepoConfig
Kubernetes APICRD Objects, Secrets, Namespace, Release Tracked Resources
Third-party charts in target namespaceDeployed by Helm according to ShturvalServiceConfig

Charts

Operator deployment (controllers, webhook, Helm engine, health checker in Pod; access to cluster API and external Helm repositories).

Deployment architecture

Links of CRD and related objects (repository, service configuration, patch, Helm release, links spec.dependency / reponame, etc.).

Illustration: Charts

CRD and resource connections


3. Life cycle

End-to-end scenario (E2E)

Sequence: repository → ShturvalServiceConfig / patches → reconciliation and release states. Useful for understanding the order of steps when parsing delays and conditions.

Illustration: End-to-end scenario (E2E)

End-to-end E2E scenario

ShturvalRepoConfig

  • Purpose (K8s resources): cluster-scoped CRD, describing one logical Helm repository for the engine in the Pod.
  • Creation/update: a record is generated from spec; if status.ready is successful, conditions Install/Sync, finalizer ops.shturval.tech/finalizer is added.
  • Deleting: the repository is deleted from the engine, the finalizer is removed. (see screenshot below)

Reconciliation scheme (create/update, delete, key branches and status.ready status).

Illustration: ShturvalRepoConfig

ShturvalRepoConfig reconciliation

ShturvalServiceConfig

  • Purpose: one object describes one Helm release in spec.namespace with the given chart name, version, repository and mode.

Modes (spec.mode):

ModeBehavior
autoInstall → drift detection → synchronization → health; when changing version — forced upgrade
manualThe operator does not change the release; status.ready without checks
absentUninstall if iscritical does not interfere
  • Reconciliation (general): before branching by spec.mode, SSPs are applied (patchMode + patchCustomValues, sorted by patchOrder); status.appliedCustomValues, status.appliedMode, status.appliedPatches are written (see the Apply SSP patches block on the diagram below).
  • Create/update (auto, summary): check repository; updating the cache if necessary; waiting for dependency / dependencyclass readiness; release status analysis; install/update; waiting for the health/drift engine to be ready; drift and health check with possible upgrade/requeue; putting the shturval.tech/system-namespace label on the namespace from spec.
  • Self-update / SSC named shturval-services: this name applies a write-lock to the locking area and a delay of 1 minute after the lock is released — plan for load peaks and change windows.
  • Removal: at iscritical — reconciliation stops with ServiceIsCritical; otherwise, no dependent SSCs are expected, then the release is removed and the ops.shturval.tech/finalizer finalizer is removed.

Reconciliation scheme (overview): branching according to spec.mode, Apply SSP patches block, Helm engine, health/drift, conditions in status.

ShturvalServiceConfig reconcile - overview

Reconciliation scheme in auto mode: repository, dependencies, install/update, drift, rollback when the release hangs, repetitions.

ShturvalServiceConfig reconciliation - auto mode

Repetition intervals (guidelines from the reconciliation logic): adding a finalizer — about a second; repo is not ready — about 5 s; health engine is not ready / service is not healthy — about 1 minute; dependencies — repeat; successful completion without requeue.

ShturvalServicePatch

  • Purpose: to override mode and/or customValues for the selected name ShturvalServiceConfig without directly editing the SSC itself.
  • Create/Update: commit observedGeneration, check for SSC existence, set ownerReference, label ops.shturval.tech/ssc → SSC name; mapping to SSC’s status.appliedPatches.
  • Merge customValues (rules): a key with the prefix - removes the corresponding key from the base; nested map are merged recursively; scalars are replaced with the value from the patch.
  • Removal: SSP does not have a separate finalizer; when a parent SSC is deleted, child objects with ownerReference are disposed of according to GC rules. The SSP controller does not handle the Delete of the SSC itself (appliedPatches predicate).

The ShturvalServicePatch controller does not install a Helm release. It links SSP to the target SSC (Accepted, ownerReference, label). Merging mode and customValues happens during ShturvalServiceConfig reconciliation. Final values are written to status.appliedCustomValues, mode to status.appliedMode, and patch names to status.appliedPatches. The Applied condition on SSP is set when the SSP name appears in ssc.status.appliedPatches.

  • Coordination SSC ↔ SSP (steps):
StepResource/signalAction (semantic)
1ShturvalServicePatchChecking the target SSC, setting Accepted
2SSP + SSCOwnerReference and link label
3ShturvalServiceConfig (reconciliation)Applying patches; writing status.appliedCustomValues, status.appliedMode, status.appliedPatches
4SSPApplied upon the fact that the name is included in ssc.status.appliedPatches

SSP reconciliation scheme: SSC lookup, Accepted / Applied, ownerReference, matching with status.appliedPatches at ShturvalServiceConfig (see the screenshot below).

ShturvalServicePatch reconciliation


4. Diagnostics

Conditions: ShturvalRepoConfig

ConditionAt TrueWhen False / reasons
InstallRepository added to engineError adding/updating repository
SyncRepository synchronizedErrorCheckHelmRepo, ErrorRemoveHelmRepo
Uninstall—For the deletion scenario — through the finalizer, separate logic

Conditions: ShturvalServiceConfig

ConditionAt TrueWhen False / reasons
InstallThe release is installed, the version corresponds to specRuntimeRepositoryNotReady, RepositoryNotUpdated, WaitingInstallDependency, ErrConvertParams, ErrCheckSscStatus, ErrorInstallService, ErrorUpdateService, ErrorRollbackService, ReleasePending, ReleaseRollback
SyncNo drift of values and manifestsGitOpsEngineNotReady, ErrorRenderManifests, ErrorCheckValuesDrift, ErrorCheckDrift, ErrorUpdateService, ReleasePending, ErrGetPendingTime
HealthyManaged resources are healthyErrorCheckServiceHealth, ErrorServiceNotHealthy
UninstallRelease deleted (when scenario is deletion)ServiceIsCritical, WaitingUninstallDependency, ServiceUninstalling, ErrRemoveService, ErrorRemoveService, ErrorConvertParams, ErrorCheckSscStatus
PatchPatches appliedPatchFailed
UpdateNamespacenamespace tags updatedGetNamespaceFailed, UpdateNamespaceFailed

Conditions: ShturvalServicePatch

ConditionAt TrueWhen False / reasons
AcceptedSSC found, ownerReference setSSCNotFound
AppliedSSP name in ssc.status.appliedPatchesNotAppliedYet

Typical symptoms

SymptomPossible reasonAction
Webhook not ready, errors when creating SSCNo cert-manager/certificates, invalid TLS pathsCheck cert-manager scheme and Certificate status
RepositoryNotUpdated / repo not readyShturvalRepoConfig not in Sync / no registrationCheck ShturvalRepoConfig and network access to Helm repo
Long blocking when making changesModifies SSC named shturval-servicesPlan windows; consider delay up to ~1 minute
Cannot remove release (absent)iscritical: trueUncheck spec
ServiceIsCritical when deletingSee aboveRemove criticality
ReleasePending / rollbackThe release hung in pending longer than the threshold (in delivery — 5 minutes)Helm event analysis, operator logs; if necessary, manual parsing of an external release
No admission validationValidating webhook — stubAdditional pre-application spec checks (organizational policy)
SSP Accepted=false, SSCNotFoundTarget SSC not yet created or name in spec.shturvalServiceConfigName is wrongCheck SSC presence; SSP controller periodically retries reconcile
SSP Applied=false, NotAppliedYetSSC has not yet completed reconcile with patch applicationCheck status.appliedPatches and condition Patch on SSC

5. Installation / deployment

The module is installed by cluster-manager as part of the platform configuration. The administrator only needs to ensure that cert-manager is present in the cluster (see Limitations) and that the operator Pod, CRDs and webhooks are in working order.

Helm delivery order and chart parameters

Environment Dependencies

  • cert-manager version 1.x or higher in a cluster — for TLS webhook operator (see Limitations).

Helm delivery order

The delivery is divided into two charts with fixed names in Chart.yaml (see §2):

  1. shturval-services-crds — CRD;
  2. shturval-services — operator (controllers, webhook) in namespace shturval-services-system.

The Helm release names and chart repository URLs are set in your platform delivery loop.

Chart parameters (summarized from the technical description)

The typical values of the main chart (without reference to internal paths) provides by default, in particular:

Parameter (logical)Description
replicaCountNumber of Deployment replicas (typically 1)
tolerations / affinityConvergence with infrastructure nodes / Control Plane (template for a specific cluster)

Note: custom edits to values in operation under the Shturval platform are consistent with the delivery policy; for custom overlay values, use ShturvalServicePatch (SSP) where applicable to the service that delivers the operator.

Post-deployment check (no hard commands)

Make sure that the operator Pod in the target namespace has moved to Ready, CRDs are registered, Mutating/ValidatingWebhookConfiguration objects refer to a running Service and certificates (if the scheme is consistent with cert-manager). The specific kubectl commands are not given in the technical manual; use standard procedures in your environment.


6. Operator parameters

Any changes to values for the chart that delivers the operator in the Shturval platform environment must be made through ShturvalServicePatch, if this applies to the corresponding ShturvalServiceConfig.

Limitations not displayed in the custom Helm chart: MaxHistory=2 for releases, thresholds for waiting for a pending release, wait durations for install/uninstall, fixed self-update delays — specified in the image of the delivered version; a new version of the image/operator is required to change.

Process arguments (from the technical manual)

Process parameters explicitly described in the technical manual are listed. In practice, they are set by container arguments and, if necessary, environment variables in the delivery manifest/Helm values.

ParameterDefault (from manual)Description
--metrics-bind-address00 — metrics are disabled; otherwise address/port
--health-probe-bind-address:8081Listening to health/readiness
--leader-electfalseLeader election
--metrics-securetrueHTTPS for metrics (if enabled)
--enable-http2falseHTTP/2 for metrics servers and webhook
--webhook-cert-pathemptyTLS directory for webhook
--webhook-cert-nametls.crtCertificate file name
--webhook-cert-keytls.keyKey file name
--metrics-cert-pathemptyTLS directory for metrics server
--metrics-cert-nametls.crtMetrics certificate name
--metrics-cert-keytls.keyMetrics key name
--repo-config/helmDirectory with repositories.yaml
--repo-cache/helmRepository cache
--helm-timeout5mHelm operations timeout
ENABLE_WEBHOOKS(not set — webhooks enabled)false — disable webhook registration (for example, an environment without TLS)

7. CRD/API reference

API Group: ops.shturval.tech. Storage version: v1beta2. Spoke: v1beta1 (conversion).

7.1 ShturvalRepoConfig - Cluster

Short name: (not specified in excerpt; Kind — ShturvalRepoConfig.) Scope: Cluster.

Without a registered and ready repository, ShturvalServiceConfig referencing this name will not be served.

spec

FieldTypeRequiredDescription
urlstringYesHelm repository URL
usernamestringNoLogin
passwordstringNoPassword
insecureboolNoBypassing TLS certificate verification

Important: The client TLS fields for the repository in the API are not available (commented out/not used) — mTLS/client certificates are not supported without a product change.

status

FieldTypeDescription
readybooltrue upon successful registration
conditionscondition arrayState

Conditions

See §4. Diagnostics. For Install when False — including error with RepoAddOrUpdate.


7.2 ShturvalServiceConfig - Cluster (shortName: ssc)

One object — one Helm release in spec.namespace.

spec

FieldTypeRequiredDescription
modeenum: auto / manual / absentYesMode; default auto
chartstringYesChart name (name template from CRD)
versionstringNoChart version
namespacestringYesNamespace installation
reponamestringYesName ShturvalRepoConfig
dependency[]stringNoSSC dependency names
dependencyclass[]stringNoSSC classes (one Ready SSC with shturval.tech/class label is enough)
serviceclassstringNoClass of service; webhook copies to label shturval.tech/class
extraargsmap[string]stringNoAdditional Helm arguments
customvaluesmap[string]interface{}NoHelm values (no hard scheme)
iscriticalboolNoIf true, deleting via absent is disabled

status

FieldTypeDescription
readyboolGeneral readiness
currentModeenumActual mode
currentVersionstringInstalled version
conditionscondition arrayState
appliedCustomValuesmapFinal values after patches (written during SSC reconciliation)
appliedModeenumMode after patches
appliedPatches[]stringNames of applied ShturvalServicePatch

Conditions

See §4. Diagnostics.


7.3 ShturvalServicePatch - Cluster (shortName: ssp)

Patch for mode and/or customValues for the specified SSC.

spec

FieldTypeRequiredDescription
shturvalServiceConfigNamestringYesTarget name ShturvalServiceConfig
patchOrder*intNoOrder (less is earlier; nil is treated as 0)
modeenumNoOverrides spec.mode SSC
customvaluesmap[string]interface{}NoRecursive merge over spec.customvalues SSC

status

FieldTypeDescription
observedGenerationint64Last generation processed
conditionscondition arrayState

Conditions

See §4. Diagnostics.


Finalizer (all listed CRDs according to logic): ops.shturval.tech/finalizer (no separate finalizer required for SSP — see §3).