Multi-Cluster Inspection (TargetCluster) and Federated Fleet
Faber supports two complementary multi-cluster architectures so you can choose centralized inspection, decentralized autonomous spokes, or both together.
Choosing the Right Pattern
Section titled “Choosing the Right Pattern”| Pattern | Topology | Network Direction | Best For |
|---|---|---|---|
TargetCluster (ftc) |
One central Faber operator connects to remote Kubernetes API servers. | Hub outbound to remote Kubernetes APIs. | Cross-cluster read-only diagnostics, correlating control-plane and workload clusters, small fleets where central kubeconfigs are acceptable. |
Federated Fleet (hub / spoke) |
Independent Faber operators run inside each cluster and sync to a central Hub. | Spokes outbound-only to Hub (POST /api/v1/fleet/ingest). Zero inbound ports on spokes. |
Air-gapped, NAT-ed, or high-security clusters where kubeconfigs must never leave each cluster and every cluster runs its own local LLM, sandbox, and PR loops. |
Part 1: Multi-Cluster Inspection with TargetCluster
Section titled “Part 1: Multi-Cluster Inspection with TargetCluster”The TargetCluster CRD (shortNames: ftc, tcluster) registers a remote Kubernetes cluster in the same namespace as the policies or tool profiles that inspect it.
Registering a Remote Cluster
Section titled “Registering a Remote Cluster”Each TargetCluster configures exactly one credential source (enforced by a CRD CEL rule):
spec.kubeconfigSecretRef: References a same-namespace Secret containing kubeconfig YAML (default keykubeconfig).spec.endpoint: Direct API server URL (https://orhttp://) paired withbearerTokenSecretRef(required) and optionalcaSecretReforinsecureSkipTLSVerify.
Option A: Kubeconfig Secret
Section titled “Option A: Kubeconfig Secret”kubectl -n faber create secret generic eu-west-prod-kubeconfig \ --from-file=kubeconfig=./eu-west-prod.kubeconfigapiVersion: faberops.dev/v1alpha1kind: TargetClustermetadata: name: eu-west-prod namespace: faberspec: kubeconfigSecretRef: name: eu-west-prod-kubeconfig key: kubeconfig defaultNamespace: production allowedNamespaces: - production - ingress-system readOnly: true labels: region: eu-west-1 env: production tier: workloadOption B: Direct API Server Endpoint and Bearer Token
Section titled “Option B: Direct API Server Endpoint and Bearer Token”apiVersion: faberops.dev/v1alpha1kind: TargetClustermetadata: name: us-east-staging namespace: faberspec: endpoint: server: https://k8s.us-east-staging.example.com:6443 caSecretRef: name: us-east-staging-auth key: ca.crt bearerTokenSecretRef: name: us-east-staging-auth key: token defaultNamespace: staging allowedNamespaces: - staging readOnly: true labels: region: us-east-1 env: stagingSafety Controls and Credential Rotation
Section titled “Safety Controls and Credential Rotation”- Read-only by default:
spec.readOnlydefaults totrueat runtime whenever omitted. - Namespace boundary:
spec.allowedNamespacesrestricts remote inspection strictly to the listed namespaces. When omitted, access is bounded by the remote credential’s own Kubernetes RBAC. - Unconditional Secret block: Remote
k8s_get,k8s_list,k8s_logs, andk8s_eventscalls unconditionally block corev1Secretaccess, just like local cluster tools. - Automatic credential refresh: The multi-cluster client pool caches remote Kubernetes clients keyed by both
TargetClusterresourceVersionand referenced SecretresourceVersion, rebuilding clients automatically whenever you rotate a token or kubeconfig Secret. - Same-namespace isolation:
targetClusterRefsstay within the referencing resource’s namespace unless--allow-cross-namespace-refs=true(controller.allowCrossNamespaceRefs=true) is explicitly enabled.
Binding Multi-Cluster Scopes to a ToolProfile or MaintenancePolicy
Section titled “Binding Multi-Cluster Scopes to a ToolProfile or MaintenancePolicy”Reference up to 10 TargetCluster objects via ToolProfile.spec.targetClusterRefs or MaintenancePolicy.spec.targetClusterRefs, then set cluster: <targetcluster-name> on each remote kubernetes tool scope (leaving cluster empty targets the local cluster):
apiVersion: faberops.dev/v1alpha1kind: ToolProfilemetadata: name: multicluster-readonly namespace: faberspec: targetClusterRefs: - name: eu-west-prod kubernetes: - apiGroups: [""] resources: ["pods", "events"] namespaces: ["production"] verbs: ["get", "list"] - cluster: eu-west-prod apiGroups: [""] resources: ["pods", "events"] namespaces: ["production", "ingress-system"] verbs: ["get", "list"] - cluster: eu-west-prod apiGroups: ["apps"] resources: ["deployments", "statefulsets"] namespaces: ["production"] verbs: ["get", "list"]During a run, the agent passes the optional cluster argument to k8s_get, k8s_list, k8s_logs, and k8s_events to correlate local and remote cluster state in one investigation. See the full runnable manifest at config/samples/targetcluster-remote.yaml.
Verifying TargetCluster Connectivity
Section titled “Verifying TargetCluster Connectivity”TargetClusterReconciler probes the remote cluster discovery endpoint and updates status.ready, status.kubernetesVersion, status.lastCheckedAt, and the Ready condition (Connected, SecretNotFound, or ConnectionFailed). Check connectivity with kubectl or faberctl:
kubectl -n faber get targetclustersfaberctl clusters list --namespace faberPart 2: Outbound-Only Federated Fleet (Hub and Spoke)
Section titled “Part 2: Outbound-Only Federated Fleet (Hub and Spoke)”In Federated Fleet mode, each cluster runs a full autonomous Faber spoke (fleet.role=spoke). Spokes execute triggers, LLM loops, zero-egress sandboxes, and PR commits locally without exposing any inbound port or sharing kubeconfigs with the Hub.
flowchart LR SpokeA["Spoke Cluster A (eu-west-1)\nfleet.role=spoke"] -->|"Outbound HTTPS POST /api/v1/fleet/ingest\nBearer FABER_FLEET_TOKEN"| Hub["Central Fleet Hub\nfleet.role=hub"] SpokeB["Spoke Cluster B (us-east-1)\nfleet.role=spoke"] -->|"Outbound HTTPS POST /api/v1/fleet/ingest\nBearer FABER_FLEET_TOKEN"| Hub Hub -.->|"Pending approve / reject / pause / resume\nreturned in ingest response"| SpokeA Hub -.->|"Pending approve / reject / pause / resume\nreturned in ingest response"| SpokeB Operator["Operator (Web UI / faberctl fleet)"] --> HubHow the Outbound Sync Protocol Works
Section titled “How the Outbound Sync Protocol Works”- Shared bearer token (
FABER_FLEET_TOKEN): Both Hub and Spokes mount a shared token from an existing Kubernetes Secret (fleet.tokenExistingSecret, default keytoken) into theFABER_FLEET_TOKENenvironment variable. Plaintext tokens are disallowed invalues.yaml. The Hub verifiesAuthorization: Bearer <token>using constant-time SHA-256 comparison. - Periodic spoke push: Every
fleet.syncInterval(default15s), the spoke’s leader-electedSpokeSyncersends an outboundPOST /api/v1/fleet/ingestcarrying cluster metadata (clusterId,displayName,region, Kubernetes version, pause state, waiting approval count) and recent run summaries. - Command piggybacking and acknowledgement: The Hub’s ingest response returns any pending commands (
approve,reject,pause, orresume) queued for thatclusterId. The spoke executes each command locally against its own store and controller, then sendsPOST /api/v1/fleet/commands/{id}/ackwith the execution result. - Staleness detection: A spoke that stops heartbeating for more than 2 minutes is reported stale, and
faber_fleet_clusters_onlinereflects the live online spoke count.
Step 1: Create the Shared Fleet Token Secret
Section titled “Step 1: Create the Shared Fleet Token Secret”Create the same random bearer token Secret in the Hub namespace and in each Spoke namespace (for example via External Secrets Operator or kubectl):
FLEET_TOKEN="$(openssl rand -hex 32)"
# Run on the Hub cluster and on each Spoke clusterkubectl -n faber create secret generic faber-fleet-token \ --from-literal=token="$FLEET_TOKEN"Step 2: Deploy the Fleet Hub
Section titled “Step 2: Deploy the Fleet Hub”helm upgrade --install faber oci://ghcr.io/faberops/charts/faber \ --version 2.0.0 \ --namespace faber \ --create-namespace \ --set fleet.role=hub \ --set fleet.tokenExistingSecret=faber-fleet-tokenFor production Hubs tracking many spokes, pair fleet.role=hub with PostgreSQL HA (store.driver=postgres, replicaCount=2) as described in SQLite and PostgreSQL HA.
Step 3: Deploy Each Autonomous Spoke
Section titled “Step 3: Deploy Each Autonomous Spoke”helm upgrade --install faber oci://ghcr.io/faberops/charts/faber \ --version 2.0.0 \ --namespace faber \ --create-namespace \ --set fleet.role=spoke \ --set fleet.hubUrl=https://hub.faber.example.com \ --set fleet.clusterId=eu-west-prod \ --set fleet.displayName="EU West Production" \ --set fleet.region=eu-west-1 \ --set fleet.syncInterval=15s \ --set fleet.tokenExistingSecret=faber-fleet-tokenOn HA spokes running PostgreSQL (leaderElection.enabled=true), only the active leader replica runs SpokeSyncer so heartbeats and command acknowledgements are never duplicated.
Operating the Fleet from faberctl
Section titled “Operating the Fleet from faberctl”Point faberctl at your Hub (FABER_API_URL=https://hub.faber.example.com):
# List registered spoke clusters, online/stale status, and waiting approval countsfaberctl fleet clusters
# List aggregated runs across all spokes or filter by cluster and phasefaberctl fleet runs --status WaitingApprovalfaberctl fleet runs --cluster eu-west-prod --limit 20
# Queue a remote approval or rejection for pickup on the spoke's next sync tickfaberctl fleet approve eu-west-prod run-01j9abc --reason "approved from central Hub"faberctl fleet reject eu-west-prod run-01j9abc --reason "hold until maintenance window"Fleet Audit Events and Metrics
Section titled “Fleet Audit Events and Metrics”- Audit log events:
fleet.command.queued(recorded on the Hub when a command is queued) andfleet.command.executed(recorded when execution is acknowledged). - Prometheus metrics:
faber_fleet_clusters_online: Gauge tracking federated spoke clusters currently reporting online.faber_fleet_commands_total{action,status}: Counter tracking queued, acknowledged, and failed fleet commands (approve,reject,pause,resume).