Skip to main content
Version: 2.0

Core Services

KubeOpera's backend is a set of focused Go services. Each owns one domain, its own database schema and its own API, and they cooperate through REST calls and RabbitMQ events. This page explains what they have in common, lists them all, and maps how events flow between them.

Service catalog​

GroupServicePortWhat it does
Platformkubeopera-api8090Apps, deployments, builds, CloudSpaces, clusters, federation.
auth-service8081Identity, tokens, SSO, RBAC and credential storage.
k8s-monitor8085Health scores, cost, metrics and anomaly signals.
Security8086Vulnerability scanning, posture and compliance.
cicd-gateway8087CI/CD webhooks, pipelines and runs.
nodes-manager8115Node pools, Karpenter, spot and consolidation.
cache-service8080Shared caching and rate-limit counters.
Automationanomaly-detector8088Alert rules and self-healing.
predictive-scaler8089Load forecasts and scaling decisions.
incident-manager8090Incidents, correlation, runbooks and notifications.
App deliveryApp lifecycle8112Manifest generation from an app schema.
app-controller—Reconciles KubeOperaApp resources through GitOps.
build-service8098Container image builds from source.
app-advisor-srv8105Per-app profiles, advice and live metrics.
advisor-controller—Runs an App Advisor in each tenant's vCluster.
Observabilitylog-gateway8099Logs and log patterns (Loki).
slo-manager8100SLOs, error budgets and burn rates.
apm-gateway8101Application performance metrics (Prometheus).
tracing-gateway8102Traces and service maps (Jaeger).
rca-engine8103AI root-cause analysis.
Optimizationkubeopera-ai (Optimizer)8113Continuous AI health and optimization analysis.
k8s-optimizer8097ML-based resource right-sizing.
Infrastructuretenant-controller—Reconciles Tenant resources into CloudSpaces.
host-cluster-controller—Reconciles HostCluster resources.
cluster-provisioner—Provisions cloud clusters with Terraform.
gitops-scaffolder—Generates GitOps environments for new clusters.

The reactive AI pipeline and agent runtime are documented in AI Agents: observability-agent-srv (8092), analysis-agent-srv (8093), action-agent-srv (8094), feedback-agent-srv (8095), recommendation-agent-srv (8096) and agent-runtime (8111).

Service port reference​

Use these ports with kubectl port-forward when you need to reach a service directly:

kubectl port-forward -n kubeopera-core svc/k8s-monitor 8085:8085
curl localhost:8085/healthz

Two services share port 8090 (kubeopera-api and incident-manager); they have different Service names, so forward each to a different local port if you need both.

How every service is built​

Services follow hexagonal architecture — business logic in the middle, with adapters for HTTP, messaging and storage around it — so every service is laid out the same way:

cmd/server/main.go                   Entry point: wire dependencies, start the server
internal/
core/
domain/ Domain types
ports/ Interfaces: repositories, publishers, clients
services/ Business logic (depends only on ports)
adapters/
http/ Router, handlers, auth middleware, DTOs
messaging/rabbitmq/ Consumers and publishers
repository/postgres/ Database repositories
migrations/ SQL migrations for the service's own schema
deployments/
base/ Kubernetes manifests
overlays/{development,staging,production}/
Dockerfile

Once you've read one service, you can find your way around any of them.

Shared conventions​

ConcernConvention
HTTPchi router; JSON APIs under /api/v1; GET /healthz for liveness and readiness; GET /metrics for Prometheus; OpenAPI at /openapi.json.
AuthEvery API requires authentication through the shared auth middleware: user or service tokens issued by auth-service.
DataEach service owns a PostgreSQL schema; no foreign keys or queries across schemas. Migrations run on startup and must succeed before the service reports ready.
MessagingDurable RabbitMQ topic exchanges; queue names {consumer}.{exchange}; failed messages retried, then dead-lettered to {queue}.dlq.
ConfigurationEnvironment variables; required variables are validated at startup.
ObservabilityStructured JSON logs, Prometheus metrics, OpenTelemetry traces.

Events​

Services publish what they learn to RabbitMQ topic exchanges, and any service can subscribe. This is how KubeOpera grows: new capabilities subscribe to existing events without changing the services that publish them.

ExchangeRouting keysPublisherConsumers
observability.telemetrytelemetry.{cluster}observability-agent-srvanalysis-agent-srv
analysis.decisionsdecision.{type}analysis-agent-srvaction-agent-srv
analysis.insightsinsight.{severity}analysis-agent-srvrecommendation-agent-srv, agent-runtime
action.outcomesoutcome.{status}action-agent-srvfeedback-agent-srv
feedback.signalssignal.{type}feedback-agent-srvanalysis-agent-srv
k8s.anomaliesanomaly.{source}.{severity}k8s-monitor, kubeopera-aianomaly-detector, incident-manager
k8s.selfhealselfheal.{status}anomaly-detectorincident-manager
security.postureposture.{severity}security-collectorincident-manager
cicd.eventscicd.{provider}.{event}cicd-gatewayobservability-agent-srv, incident-manager
incidents.eventsincident.{event}incident-managerkubeopera-api (webhooks), agent-runtime
nodes.eventsnodes.{event}nodes-managerincident-manager, observability-agent-srv

Routing keys start with a fixed segment per exchange, and consumers bind with a pattern such as anomaly.#, so every publisher's messages reach every consumer of that exchange.

Next steps​