Advanced Configuration
KubeOps works out of the box with sensible defaults. This section covers everything you can tune when the defaults no longer fit: reconciliation behavior, queuing, leader election, validation, and customization of generated resources.
Configuring the Operator
Pass a configuration callback to AddKubernetesOperator to customise the operator before it starts.
Every option has a sensible default, so you only need to configure what you want to change:
builder.Services
.AddKubernetesOperator(settings => settings
.WithNamespace("my-namespace")
.WithLeaderElection(LeaderElectionType.Single));
Each With* method corresponds to one of the options described on the pages of this section:
| Page | What it controls |
|---|---|
| Reconcile Strategy | Which watch events trigger a reconciliation (ByGeneration vs. ByResourceVersion) |
| Watch Strategy | How watch connections to the API server are created (PerController vs. SharedPerEntity) |
| Queue Strategy | How reconciliation work is scheduled and dispatched (InMemory vs. Custom) |
| Parallel Reconciliation | Concurrency limits and conflict handling for simultaneous reconciliations |
| Leader Election | How multiple operator instances coordinate (None, Single, Custom) |
| Finalizer Lifecycle | Automatic attachment and detachment of finalizers |
| External Reconciliation Triggers | Requesting reconciliation from outside the watch stream (HTTP, message bus) |
| Caching | The watcher's event deduplication cache (FusionCache) |
| Registration Validation | Startup validation of the operator's DI registrations |
| Customizing Resource Generation | Replacing or extending the CRD, webhook, and event factories |
| CRD Installer | Installing CRDs from the operator during development |