Skip to content

feature(operator): VersusIncident Kubernetes operator (CRD + controller)#263

Open
nghiadaulau wants to merge 1 commit into
VersusControl:mainfrom
nghiadaulau:feature/versus-incident-operator
Open

feature(operator): VersusIncident Kubernetes operator (CRD + controller)#263
nghiadaulau wants to merge 1 commit into
VersusControl:mainfrom
nghiadaulau:feature/versus-incident-operator

Conversation

@nghiadaulau

Copy link
Copy Markdown
Member

What

A Kubernetes operator (kubebuilder / controller-runtime, group ops.versuscontrol.io) that manages Versus Incident declaratively — a self-healing alternative to the Helm chart. A single VersusIncident custom resource reconciles into a ConfigMap + Deployment + Service with owner references (garbage collection) and status reporting.

Lives in its own nested Go module under operator/ so the app module is untouched — CI's go build ./... skips it.

apiVersion: ops.versuscontrol.io/v1alpha1
kind: VersusIncident
spec:
  image: { repository: ..., tag: ... }
  gatewaySecretName: versus-secrets
  telegram: { enabled: true, secretName: versus-secrets }
  agent:
    mode: detect
    ai: { baseURL: "...gemini...", model: gemini-2.5-flash-lite, apiKeySecretName: versus-secrets }

Highlights

  • CRD + RBAC + DeepCopy generated via controller-gen; standard kubebuilder layout (api/, internal/controller/, config/, Makefile, PROJECT).
  • Secrets are referenced, never embedded in the CR.
  • The rendered in-pod config includes the full agent detection config (regex/redaction/miner/catalog/service_patterns) so the agent works out of the box.
  • make docker-build deploy, then kubectl apply a CR.

Verified

On minikube: CR → operator reconciles into Deployment/Service/ConfigMap (owner refs); pod healthy; agent boots mode=detect, runs the full detect → Gemini → Telegram loop; deleting the CR cascade-deletes all children; recreating self-heals. go build/go vet clean.

🤖 Generated with Claude Code

A controller-runtime operator (group ops.versuscontrol.io) that reconciles a
VersusIncident custom resource into a ConfigMap + Deployment + Service with
owner references (garbage collection) and status reporting. The CR exposes a
provider enum (openai/gemini) and a full sources list (file/loki/
elasticsearch). Lives in its own nested Go module under operator/ so the app
module is untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nghiadaulau nghiadaulau force-pushed the feature/versus-incident-operator branch from 79ac03d to b27d012 Compare June 20, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant