Compact, repo-specific guidance for OpenCode sessions.
EKCO (Embedded kURL cluster operator) is a single Go binary that runs as a Kubernetes operator to maintain the health of a kURL cluster. It is not a library or multi-service repo.
- Language / toolchain: Go (module
github.com/replicatedhq/ekco) - Entrypoint:
cmd/ekco/main.go - CLI framework: Cobra / Viper (commands live in
cmd/ekco/cli/) - Primary command:
ekco operator(long-running operator) - Other commands:
purge-node,rotate-certs,regen-cert,change-load-balancer,generate-haproxy-*,set-kubeconfig-server(seecmd/ekco/cli/)
Use the Makefile. Do not guess the Go version or linter config.
# Install tooling (golangci-lint)
make deps
# Full verification — order enforced by Makefile: lint -> vet -> test
make test
# Build binary (outputs bin/ekco)
make build
# Build Docker image
make docker-imageLint rules are non-default. .golangci.yaml disables errcheck and staticcheck, and ignores all *_test.go files (exclusions.paths). Do not re-enable them locally.
Test scope: go test ./pkg/... ./cmd/... — only pkg and cmd; there is no root-level test target.
- The Dockerfile is at
deploy/Dockerfile, not the repo root. ROOK_VERSIONdefaults to1.11.8in the Makefile and Dockerfile.- The build stage downloads Helm and pulls
rook-ceph-clusterchart intopkg/helm/charts. - Git SHA / version are injected via ldflags at build time (
pkg/version).
Do not use make docker-image && kubectl apply -k deploy/ — the README notes this is broken and out of sync.
Current workflow (from README):
make build-ttl.sh— pushes a temporary image tottl.sh/${USER}/ekco:12h.- Deploy a kURL cluster that includes EKCO.
- Patch the deployment:
kubectl edit -n kurl deployment/ekc-operator # set image to ttl.sh/<user>/ekco:12h and imagePullPolicy: Always kubectl delete pod -l app=ekc-operator -n kurl
Generated with github.com/golang/mock:
make generate-mocksThis currently only covers pkg/k8s/exec.go → pkg/k8s/mock/mock_exec.go.
There are none. The repo is a single Go module with two top-level directories:
cmd/— CLI commands andmain.gopkg/— operator logic, cluster controller, K8s clients, webhooks, cert rotation, object-store helpers, etc.deploy/— Dockerfile, Kustomize manifests, and RBAC for the operator
No frontend, no separate API service, no nested Go modules.
- Deep integration with Rook Ceph, Kubernetes, Contour, Velero, etcd, and Prometheus Operator.
go.modcarries a large set ofreplaceandexcludeblocks inherited from Rook. Do not prune them; they resolve transitive conflicts.- CI uses
go-version-file: 'go.mod'so the declared Go version is the source of truth.
- PRs:
make deps test build+make docker-image(pushed tottl.sh). - Main branch:
make docker-imagepushed toreplicated/ekco:alpha. - Releases: Push a semver tag
v*.*.*(e.g.git tag -a v0.1.0 -m "Release v0.1.0" && git push origin v0.1.0). Image is pushed toreplicated/ekco:<tag>. - Scheduled vulnerability scans use Grype (
.grype.yaml) against the repo and the built image.
- Prefer
Makefiletargets over rawgocommands — ldflags and build args matter. - Trust executable configs (
Makefile,.golangci.yaml,.github/workflows/) over prose in README for build/test steps.