Kubernetes operator
The OpenMetadata Kubernetes operator manages pipeline runs through Kubernetes custom resources. It gives each run a main ingestion step and a follow-up exit handler to support reliable completion actions, while scheduled pipelines use a custom schedule resource that creates those runs. This page complements Deployment operations and Containerized deployment.
System role
Deployment boundary
The operator is a Kubernetes control service for OpenMetadata ingestion work. It does not deploy the full OpenMetadata platform. The OpenMetadata server creates the custom resources and supporting configuration, then the operator turns those resources into short-lived workload pods.
The operator supports two custom resources:
| Resource | Purpose |
|---|---|
OMJob | Run one ingestion job with a main pod and an exit handler pod. |
CronOMJob | Create one OMJob for each due cron time. |
The OpenMetadata Kubernetes pipeline client selects this path only when useOMJobOperator is true. Otherwise, it uses native Kubernetes Job and CronJob resources.
References: openmetadata-service/…/K8sPipelineClient.java• L250-281 openmetadata-service/…/K8sPipelineClient.java• L407-438 openmetadata-k8s-operator/…/OMJobOperatorApplication.java• L30-39
Resource boundary
Both custom resources are namespaced and use the pipelines.openmetadata.org/v1 API group. The resource spec describes the work to run. The resource status gives operators and OpenMetadata a small record of the current phase, related pod names, times, and outcome.
The operator owns the pods created for an OMJob. This ownership lets Kubernetes remove those pods with the custom resource and lets the operator find them again after a reconciliation restart.
References: openmetadata-k8s-operator/…/omjob-crd.yaml• L1-15 openmetadata-k8s-operator/…/omjob-crd.yaml• L347-393 openmetadata-k8s-operator/…/cronomjob-crd.yaml• L1-15 openmetadata-k8s-operator/…/cronomjob-crd.yaml• L316-345 openmetadata-k8s-operator/…/PodManager.java• L318-343
Installation model
Helm installation
The operator is enabled as part of the OpenMetadata Helm deployment. The installation must make the two custom-resource definitions available before the OpenMetadata server creates OMJob or CronOMJob objects. It must also give the operator permission to watch those objects and to create, inspect, update, and delete their workload pods.
The operator is delivered as a runnable Java artifact and a container image for deployment in the cluster. The OpenMetadata server and the operator remain separate actors: the server submits work to the Kubernetes API, while the operator watches the custom resources and keeps workload state moving toward the requested result.
References: openmetadata-k8s-operator/README.md• L96-130 openmetadata-k8s-operator/pom.xml• L12-24 openmetadata-k8s-operator/pom.xml• L151-180 openmetadata-k8s-operator/…/OMJobOperatorApplication.java• L74-128
Operator startup
At startup, the operator connects to the Kubernetes API, registers both reconcilers, and starts watching either all namespaces or one namespace. WATCH_NAMESPACES accepts ALL or a namespace value. When a comma-separated list is supplied, the current operator uses the first namespace because its watch setup supports one specific namespace.
The operator exposes liveness and readiness checks. Readiness includes a Kubernetes API check after startup, so a running process is not treated as ready when it cannot reach the cluster.
References: openmetadata-k8s-operator/…/OMJobOperatorApplication.java• L74-143 openmetadata-k8s-operator/…/HealthCheckService.java• L61-89 openmetadata-k8s-operator/…/HealthCheckService.java• L152-203
Configuration model
OpenMetadata pipeline settings
The pipeline client holds the settings that define how an ingestion workload should run. When the operator path is enabled, those settings are copied into the OMJob or CronOMJob template and then into the created pods.
The important settings are:
| Setting | System effect |
|---|---|
useOMJobOperator | Selects custom resources instead of native Kubernetes jobs. |
namespace | Selects the namespace for custom resources, pods, ConfigMaps, and Secrets. |
ingestionImage | Selects the image used for ingestion and exit-handler work. |
serviceAccountName | Selects the identity used by workload pods. |
resources, node placement, and security settings | Shape pod scheduling and runtime limits. |
ttlSecondsAfterFinished | Sets how long completed workload pods remain before cleanup. |
startingDeadlineSeconds | Sets the allowed delay for a scheduled run. |
extraEnvVars and podAnnotations | Pass additional run context and cluster metadata to workload pods. |
The client keeps pipeline configuration in a ConfigMap and connection security data in a Secret. Pods read those resources at run time, so a pipeline deployment can update shared configuration without changing every run object.
References: openmetadata-service/…/K8sPipelineClientConfig.java• L36-134 openmetadata-service/…/K8sPipelineClient.java• L387-443 openmetadata-service/…/K8sPipelineClient.java• L1225-1256 openmetadata-service/…/README.md• L35-44
Operator runtime settings
The operator reads its own settings from environment variables. These values control how fast it checks workload state, how it retries failed reconciliation, and where it serves operational endpoints.
| Variable | Default | Purpose |
|---|---|---|
WATCH_NAMESPACES | ALL | Limits the namespace watch when set to one namespace. |
OPERATOR_NAMESPACE | default | Names the operator's configured namespace value. |
RECONCILIATION_THREADS | 5 | Sets the intended level of concurrent reconciliation. |
POLLING_INTERVAL_SECONDS | 10 | Sets the normal delay while a workload pod is running. |
REQUEUE_DELAY_SECONDS | 30 | Sets the delay after a reconciliation error or schedule check. |
HEALTH_CHECK_PORT | 8080 | Serves health and readiness checks. |
LOG_LEVEL | INFO | Controls operator and controller log detail. |
The operator retries reconciliation with increasing delays and caps the retry interval. These controls affect recovery speed. They do not change the OMJob lifecycle or the result reported by a workload.
References: openmetadata-k8s-operator/…/OperatorConfig.java• L24-59 openmetadata-k8s-operator/…/application.yaml• L47-57 openmetadata-k8s-operator/…/application.yaml• L75-81 openmetadata-k8s-operator/…/OMJobReconciler.java• L59-74
Reconciliation lifecycle
On-demand execution
An on-demand pipeline run starts when the OpenMetadata server creates an OMJob. The operator treats the resource as the durable description of the run. Each reconciliation reads the current resource and cluster state, then makes only the next required change.
This diagram shows the normal path from a custom resource to a completed pipeline result.
flowchart TD
A[OpenMetadata server creates OMJob] --> B[Operator observes OMJob]
B --> C[Create or find main ingestion pod]
C --> D[Monitor main pod]
D --> E{Main pod completed?}
E -- No --> D
E -- Yes --> F[Record main pod result]
F --> G[Create or find exit handler pod]
G --> H[Monitor exit handler]
H --> I{Exit handler completed?}
I -- No --> H
I -- Yes --> J[Set OMJob Succeeded or Failed]
J --> K[Clean up pods after TTL]
The main pod result determines the status passed to the exit handler. The final OMJob result depends on the exit handler result, so the follow-up action runs after normal completion and after a main pod failure.
References: openmetadata-service/…/K8sPipelineClient.java• L557-611 openmetadata-k8s-operator/…/OMJobReconciler.java• L77-133 openmetadata-k8s-operator/…/OMJobReconciler.java• L156-308
OMJob state model
OMJob uses a small state model that makes progress visible through the Kubernetes API. Pending means that the main pod is not yet present. Running means that the main pod is being watched. ExitHandlerRunning means that the main pod has ended and the follow-up pod is active. Succeeded and Failed are terminal states.
The status records the main and exit-handler pod names, the main pod exit code, transition messages, and start and completion times. A terminal resource is not run again by reconciliation. If a time-to-live is set, the operator later removes the pods associated with the resource.
References: openmetadata-k8s-operator/…/OMJobPhase.java• L18-77 openmetadata-k8s-operator/…/OMJobStatus.java• L21-73 openmetadata-k8s-operator/…/OMJobReconciler.java• L311-345
Scheduled execution
Scheduled pipelines use CronOMJob as a schedule and template. The operator checks the cron expression and time zone, ignores suspended schedules, and avoids creating the same scheduled run more than once. For each due time, it creates a new OMJob with a concrete run identity. That OMJob then follows the same two-stage lifecycle as an on-demand run.
The schedule can keep a bounded history of successful and failed runs. A starting deadline prevents an old schedule from creating a late run after the allowed window has passed.
References: openmetadata-service/…/K8sPipelineClient.java• L1284-1318 openmetadata-k8s-operator/…/CronOMJobReconciler.java• L76-166 openmetadata-k8s-operator/…/cronomjob-crd.yaml• L16-39 openmetadata-k8s-operator/…/cronomjob-crd.yaml• L308-345
Pipeline control actions
The OpenMetadata server controls a deployed pipeline by changing or deleting its Kubernetes resources. Toggling a scheduled pipeline changes the custom schedule's suspend state. Killing a run deletes its OMJob resources and leaves pod cleanup to the operator's ownership and lifecycle rules. Deleting a pipeline removes its active runs, schedule, Secret, and ConfigMap.
These actions depend on the same namespace and pipeline labels used when the resources were created. A mismatch can make a pipeline appear deployed while its control action finds no matching custom resource.
References: openmetadata-service/…/K8sPipelineClient.java• L627-739 openmetadata-service/…/K8sPipelineClient.java• L788-893 openmetadata-service/…/README.md• L117-127
Observability
Status and events
The Kubernetes API is the main view of a run. OMJob status shows the current phase and related pod names. The operator also publishes normal events for major lifecycle steps and warning events for reconciliation errors. These events add a short timeline without changing the resource state.
The operator exposes health, readiness, and Prometheus metrics endpoints. Logs include the OMJob name when the controller has that context, which helps connect an operator action to a resource and its pods.
References: openmetadata-k8s-operator/…/EventPublisher.java• L28-67 openmetadata-k8s-operator/…/HealthCheckService.java• L34-44 openmetadata-k8s-operator/…/HealthCheckService.java• L116-132 openmetadata-k8s-operator/…/application.yaml• L7-27
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the
pipelines.openmetadata.org/v1group, resource kinds, plural names, and client API calls aligned. A mismatch prevents the server from creating or controlling custom resources. - Keep the
OMJobphase values and allowed transitions aligned with the reconciler and the CRD status schema. A new phase that is accepted in one place but not another can strand a run. - Keep
useOMJobOperatoraligned with the installed CRDs, operator deployment, and RBAC. The server switches to the custom-resource API as soon as this flag is enabled. - Keep the
CronOMJobtemplate fields aligned with the per-runOMJobfields. Scheduled runs depend on copied pod settings and runtime run identifiers. - Keep pipeline labels and pod ownership metadata stable when changing run discovery or cleanup. Control actions and reconciliation use those relationships to find resources.
- Keep health probe ports and endpoint paths aligned with the operator deployment. A wrong probe can restart a healthy controller or mark a working controller unready.
- Keep the operator artifact, container image, and Kubernetes deployment aligned when changing the operator build entry point or runtime dependencies. A build can succeed while the deployed image uses a stale or incompatible runtime.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
useOMJobOperator=true without the custom-resource definitions | OpenMetadata cannot create or update OMJob or CronOMJob resources. | Install the CRDs before enabling the operator path. |
| The operator cannot watch the target namespace or update resources | Custom resources remain at their last status and no workload pod is created. | Check WATCH_NAMESPACES, namespace selection, and operator RBAC. |
| The main pod is absent for more than the startup grace period | The OMJob moves to Failed and no exit handler is started. | Check pod events, image access, quotas, and pod permissions. |
exitHandlerSpec is not usable | The follow-up step cannot be created, so the run fails after the main pod ends. | Provide a valid exit-handler image and pod settings in every operator-managed run. |
A scheduled execution is outside startingDeadlineSeconds | The operator records a missed schedule and does not create an OMJob. | Set the deadline to match the required catch-up behavior. |
| The operator loses Kubernetes API access | Readiness fails and reconciliation stops until access returns. | Restore cluster access and verify the operator service account and network path. |
Key files
| File | Why to read it |
|---|---|
| openmetadata-k8s-operator/…/OMJobOperatorApplication.java | Shows operator startup, custom-resource registration, namespace watch scope, and shutdown. |
| openmetadata-k8s-operator/…/OMJobReconciler.java | Shows the high-level OMJob lifecycle and status progression. |
| openmetadata-k8s-operator/…/CronOMJobReconciler.java | Shows how schedules become individual OMJob resources. |
| openmetadata-k8s-operator/…/omjob-crd.yaml | Defines the single-run resource contract and visible status fields. |
| openmetadata-k8s-operator/…/cronomjob-crd.yaml | Defines the scheduled-resource contract and schedule status. |
| openmetadata-k8s-operator/…/PodManager.java | Shows the relationship between an OMJob and its main and exit-handler pods. |
| openmetadata-service/…/K8sPipelineClient.java | Shows how OpenMetadata selects and controls the operator path. |
| openmetadata-service/…/K8sPipelineClientConfig.java | Shows the pipeline-side settings passed into Kubernetes workloads. |
| openmetadata-k8s-operator/…/application.yaml | Shows retry, endpoint, and log defaults used by the operator runtime. |
| openmetadata-k8s-operator/pom.xml | Shows the operator runtime entry point and the artifact and image packaging model. |