---
id: w1/m2/t002
title: Scaffold the control-plane Go binary + Deployment + DB connection
worker: worker1
status: done
estimate: 30m
depends_on: [w1/m2/t001]
---

## Objective

Create the control-plane service skeleton: a new Go binary in the `operator/` repo (separate `cmd/`), with its own Deployment, that connects to `bex-db`.

## Context

- New `operator/cmd/controlplane/` (separate binary from the operator).
- DB connection from Secret `bex-system/bex-db-app` (`uri` key); only the control plane connects.

## Steps

1. Add `cmd/controlplane/main.go` — config, DB pool (pgx), health endpoint.
2. Add a Deployment manifest that mounts the `bex-db-app` secret as env.

## Files

- `operator/cmd/controlplane/main.go` · `operator/config/` (control-plane Deployment)

## Acceptance criteria

- [ ] The binary starts, connects to `bex-db`, and serves `/healthz` (DB ping) 200.

## Out of scope

- Schema, reconciler, API (t003–t006).
