Skip to main content

FireboltInstance reconciler

The FireboltInstanceReconciler manages the infrastructure that engines depend on: PostgreSQL, the metadata service, and the Envoy gateway proxy. It follows the same level-triggered principles as the engine reconciler.

Architecture

Reconcile steps

Each Reconcile call runs through four sequential steps. If any step fails, the reconciler requeues after a short delay and retries from the beginning (earlier steps are idempotent and effectively no-ops when resources already exist).

Instance lifecycle phases

The instance starts in Provisioning and transitions to Ready once both the metadata service and gateway have at least one ready replica. If a previously-ready component becomes unhealthy, the phase transitions to Degraded. It returns to Ready once all components recover. The Failed phase is terminal and indicates a condition that cannot be resolved by re-reconciliation alone. The Firebolt Operator continues to requeue but will not transition out of Failed without manual intervention. When the metadata service or gateway becomes not-ready, the Firebolt Operator clears the corresponding endpoint from the instance status (metadataEndpoint or gatewayEndpoint). This ensures that dependent engines observe consistent state and block until the instance is fully operational again.

Component pod templates

spec.gateway.template and spec.metadata.template are raw PodTemplateSpec embeds with the same shape as FireboltEngineClass.spec.template. Two effective* helpers live alongside their builders and produce the resolved pod template that the Deployment carries:
  • effectiveGatewayPodTemplate(...) in instance_gateway.go.
  • effectiveMetadataPodTemplate(...) in instance_metadata.go.
Each helper starts from a deep-copy of the user template and stamps Firebolt Operator-rendered fields on top. The validating webhook already rejected user input on any field the builder owns. See Firebolt Operator-owned fields in the CRD reference. As a result, the merge is straight-stamp rather than precedence-merge: The Deployment’s wrapper fields (Replicas, Selector, Strategy) stay on the builder. They aren’t pod-template concerns.

Integration with engine reconciler

Each FireboltEngine declares its parent instance via spec.instanceRef. During reconciliation, the engine controller resolves this reference and reads two fields from the instance’s status:
  • metadataEndpoint: The in-cluster address of the metadata gRPC service.
  • spec.id: The instance identifier, used as the metadata account ID.
These are written to the engine ConfigMap. The resolution is only required during the stable, stopped, and creating phases (all of which may build or re-materialize ConfigMaps). Phases that operate on existing resources (switching, draining, cleaning) skip instance resolution entirely, ensuring that a transient instance issue does not stall an in-flight rollout. When the instance gate blocks, it sets the InstanceReady=False condition on the engine’s status and requeues after 10 seconds. When the instance is healthy, the condition is updated to InstanceReady=True. In both cases the condition update is part of the single updateStatus call at the end of the reconcile. The engine controller performs exactly one status write per reconcile loop, never two. The engine controller watches FireboltInstance resources via Watches() with a mapper that enqueues all engines referencing the changed instance by name. This means engines react within seconds when their parent instance becomes ready, rather than waiting for error-driven backoff to expire. The spec.metadataEndpointOverride field on the engine overrides the instance-derived endpoint (but not the instance ID), supporting cross-cluster scenarios where the engine connects to a metadata service via private link.

Instance resource ownership

All resources created by the instance reconciler have:
  • An ownerReference pointing to the FireboltInstance CR.
  • A firebolt.io/instance label for listing/filtering.
  • A firebolt.io/component label (postgres, metadata, or gateway).
  • A finalizer on the CR to ensure cleanup of all labelled resources on deletion.