Architecture

Understanding the gNMIc Operator architecture

Overview

The gNMIc Operator follows the Kubernetes operator pattern to manage gNMIc telemetry collectors. It watches Custom Resources and reconciles the actual state with the desired state.

Components

This diagram illustrates how the gNMIc Operator orchestrates gNMIc deployments inside a Kubernetes cluster by reconciling Custom Resources into concrete Kubernetes primitives and gNMIc configurations.

At the core, the Cluster Controller watches a set of CRDs. It uses their desired state to create and manage resources like ConfigMaps, Secrets, Services, and a StatefulSet. The StatefulSet, together with the associated Services, materializes as multiple gNMIc pods (e.g. gnmic-0, gnmic-1, gnmic-2), each responsible for a subset of targets.

In parallel, the TargetSource Controller handles discovery use cases by watching TargetSource resources and creating concrete Target objects, which are then consumed by the Cluster Controller as part of the reconciliation flow.

Cluster Controller

The Cluster Controller is the primary controller responsible for:

  1. Creating StatefulSets: Deploys gNMIc pods with intial config (REST API, TLS certs,…)
  2. Managing Services: Creates headless service for pod DNS and Prometheus services for metrics
  3. Building Configuration: Aggregates all pipelines and builds the gNMIc pods configuration
  4. Distributing Targets: Assigns targets to pods
  5. Applying Configuration: Sends configuration to each pod via REST API

Configuration Flow

Configuration flows from Custom Resources to gNMIc pods:

Resource Model CRD Diagram

Watches and Triggers

The Cluster Controller watches multiple resources to react to changes:

ResourceWatch TypeTrigger Condition
ClusterPrimary (For)Spec changes
StatefulSetOwnedAny Change
ServiceOwnedSpec changes
CertificateOwnedAny Change
PipelineWatchSpec changes
TargetWatchSpec or label changes
TunnelTargetPolicyWatchSpec or label changes
TargetProfileWatchSpec changes
SubscriptionWatchSpec or label changes
OutputWatchSpec or label changes
InputWatchSpec or label changes
ProcessorWatchSpec or label changes

Changes to any watched resource trigger Cluster reconciliation, ensuring configuration stays synchronized.