ccluster
AGENTS.md10 starsChanged 2 days agoApache-2.0View on GitHub
Two Kubernetes operators from one Go module, with a Helm chart catalog and generated Python models. Read README.md for the project and local quickstart. This repository's conventions take precedence over generic kubebuilder scaffolding. Read the relevant document before changing the area it covers; these contain the detailed contracts and workflows omitted from this guide. CLAUDE.md points here and .claude/skills points to .agents/skills. Keep shared instructions tool-neut
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 27
Read the relevant document before changing the area it covers.
- Distinctive: line 60
Keep cp/ip RBAC separate and their leader-election IDs distinct.
- Very specific: line 68
Never hand-edit generated CRDs, the operators' generated RBAC roles, zz_generated.*.go, PROJECT, operator chart templates/ or .helmignore, …
- Distinctive: line 85
Commit the resulting generated changes.
- Very specific: line 91
Follow Kubernetes API conventions: standard types such as metav1.Time, metav1.Condition, and current observedGeneration on conditions and …
- Distinctive: line 93
Keep reconciliation idempotent and watch-driven.
- Very specific: line 96
Before a commit run make pre-commit: it tidies, regenerates, fixes lint and runs the Go, chart and Python tests.
- Distinctive: line 102
Run checks appropriate to the changed inputs, including required generators.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ccluster — Agent Guide
Two Kubernetes operators from one Go module, with a Helm chart catalog and generated Python models. Read README.md for the project and local quickstart. This repository's conventions take precedence over generic kubebuilder scaffolding.
Repository map
| Path | Purpose |
cmd/ccluster-{cp,ip}-operator/ | Separate binaries for separate clusters; cp drives Argo CD, ip verifies catalogs/cluster_base against CCLClusterConfig. |
cmd/ccluster/, internal/cli/ | The ccluster command line (cobra): init, register, unregister, server. Released as per-platform tarballs and through go install. |
internal/server/, ui/ → internal/server/ui/dist/ | ccluster server: a read-only dashboard. A net/http JSON API under /api/v1/ plus the React (Vite, TypeScript, Kaizen UI) app from ui/, whose build is embedded with go:embed. |
internal/controller/{cp,ip}/ | Per-operator controllers; shared bootstrap is in internal/manager/. |
internal/registry/ | Generic per-chart registry (chart path → function) and the *_registry packages built on it, such as the ip operator's verifier_registry, the cp operator's drift_registry, and the validator_registry that checks component values. |
api/ccluster/v1alpha1/ | CRD types; API group is ccluster.nvidia.com. |
pkg/client/ | Generated Go clientset, apply configurations, listers and informers for the API types, for programs outside this repository and for the cp operator's infra-plane watch in internal/remote/; test/client/ tests them. |
pkg/cclclient/ | Hand-written high-level client on pkg/client, the Go counterpart of Python's CCLClient: registers infra planes and applies component sets in one namespace. |
internal/argocd/v1alpha1/, internal/externaldns/v1alpha1/ | Hand-written partial Argo CD and external-dns API mirrors; extend them rather than using unstructured. |
config/ → charts/{cp,ip}/chart/ | Kustomize sources → generated operator Helm charts. Deploy with Helm. |
catalogs/ | Helm charts with typed Go values, part of the Go module: cluster_base/ platform components (each registered with a Verifier the ip operator runs), deployments/ tenant workloads, resources/ the queues and volumes they use. A chart that runs a binary built here keeps its source in a subdirectory, such as deployments/compute_deployment/compute-ssh/. |
hack/pyschema/ → python/ | CRD spec/status and chart values → JSON Schema → Pydantic package. |
examples/ | Hand-written examples. examples/quickstart/ registers a cluster and deploys an inference service through the Go SDK (compiled with the module) and Helm, and walks through the Python SDK versions in python/examples/; its manifests/ are round-tripped by the Python tests. |
Read for your task
Read the relevant document before changing the area it covers; these contain the detailed contracts and workflows omitted from this guide.
| Task | Reference |
| Reconciliation, ownership, tenancy, ordering or status | DESIGN.md |
| Adding controllers, APIs or catalog components; generators, RBAC or Helm | Development |
| Writing or running tests | Testing |
| Deploying, debugging or removing a local installation | Development: cluster operations |
| Docker, CI, the Go version, artifact versions or publishing workflows | Build and release contracts |
| Python package usage | Python README |
| Committing, pushing or opening a PR | commit-pr skill |
| Reviewing a PR or diff | pr-review skill |
| Preparing or publishing a release | release skill |
CLAUDE.md points here and .claude/skills points to .agents/skills. Keep shared
instructions tool-neutral. Put detailed procedures in the linked docs or skills rather
than expanding this file.
Architectural guardrails
- Argo CD runs only in the control-plane cluster and is installed by the cp Helm chart. The operator creates Applications; it must never install or upgrade Argo CD itself.
- Managed Argo CD resources use ownership annotations and
ownedBychecks, never owner references. Applications require explicit, reverse, one-at-a-time teardown. - Rollout order is list position. Release is monotonic: degradation must not withdraw an already released Application. Do not introduce ApplicationSet or RollingSync.
- Preserve namespace isolation: Applications live beside their CCLComponentSet; cluster Secrets and AppProjects live in the Argo CD namespace. Projects allow only the catalog repository, and cluster Secrets are project-scoped.
CCLInfraPlane Available=Trueguarantees its namespace's AppProject already exists.- The cp operator makes no cloud API calls. DNS records are published by external-dns from DNSEndpoints in the operator's namespace, never a tenant's; zones are the user's.
- Keep cp/ip RBAC separate and their leader-election IDs distinct.
- The ip operator verifies
cluster_baseand never installs, upgrades or deletes anything. Verifiers read live objects, never Argo CD or Helm release state. Its RBAC is read-only apart fromCCLClusterConfigstatus; a Verifier reading a kind adds a marker ininternal/controller/ip.
Source of truth and generation
Never hand-edit generated CRDs, the operators' generated RBAC roles, zz_generated.*.go,
PROJECT, operator chart templates/ or .helmignore, the Go client in pkg/client/, the UI build in
internal/server/ui/dist/, or generated Python modules. Edit their sources and regenerate.
charts/cp/chart/Chart.lock is generated by make helm-deps-update-cp.
Operator-chart Chart.yaml and values.yaml are preserved and may be edited. Kustomize
inputs are hand-written. Python's hand-written files are documented in
Development.
| Changed input | Regenerate |
| API types, markers or API doc comments | make manifests generate, make client-generate, make helm-generate, make python-generate |
config/ or RBAC markers | make helm-generate (includes manifest generation) |
Catalog Go values or their comments, or hack/pyschema/ | make python-generate |
hack/clientschema/ | make client-generate |
ui/ | make ui-build (needs Node; see Development) |
Commit the resulting generated changes. API and catalog doc comments ship in schemas; comment-only edits can require regeneration too. Do not install CRDs into a cluster merely to regenerate files.
Implementation and validation
- Follow Kubernetes API conventions: standard types such as
metav1.Time,metav1.Condition, and currentobservedGenerationon conditions and status. - Keep reconciliation idempotent and watch-driven; preserve the explicit teardown retry.
- Log messages are capitalized, past tense, without a trailing period, with the object type named and balanced key-value pairs.
- Before a commit run
make pre-commit: it tidies, regenerates, fixes lint and runs the Go, chart and Python tests. During iterationmake testis enough. - New controller behaviour belongs in envtest. Use selective table tests for states envtest cannot cheaply reach. Test contracts, not implementation details.
- Envtest does not prove RBAC or running watch wiring; use
make test-e2efor those.make test-e2e-fulladds real Argo CD reconciliation. See the testing guide for setup. - Run checks appropriate to the changed inputs, including required generators. Report what ran and any checks that could not run; the commit skill has the pre-commit matrix.
Cluster safety
- Pin the intended cluster with a dedicated
KUBECONFIGbefore cluster operations. Helm targets also acceptKUBE_CONTEXT_CP/KUBE_CONTEXT_IP; do not put flags inKUBECTL. Standalonedeploy-cp/deploy-ipotherwise use the current context. - Helm owns deployed CRDs: do not run
make installbeforemake deploy-cp. Existing CRDs can be adopted withmake helm-adopt-crds-cp; see the development guide. - Deleting a CRD deletes its CRs.
make undeploy-cpkeeps CRDs but removes bundled Argo CD; finish required CR teardown while the controllers still run. make cleandeletes development clusters;make clean-allalso removes tools and build output. E2e creates and deletes its own two clusters: never use a working cluster asKIND_CLUSTER_E2E_CPorKIND_CLUSTER_E2E_IP.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

