Skip to content

Config Connector Concepts

llms.txt lists every page for an agent

Every exported resource declaration becomes a Config Connector manifest document in the generated YAML.

Every Config Connector resource has four standard fields:

FieldSourceExample
apiVersionResolved from resource typestorage.cnrm.cloud.google.com/v1beta1
kindResolved from resource typeStorageBucket
metadataFrom metadata property{ name: "my-bucket", labels: {...} }
specFrom remaining propsResource-specific configuration

Config Connector resources reference each other using resourceRef:

# By name (same namespace)
resourceRef:
name: my-network
# By external reference (cross-project)
resourceRef:
external: projects/my-project/global/networks/my-network

In chant, resource references resolve automatically:

export const network = new ComputeNetwork({ autoCreateSubnetworks: false });
export const subnet = new ComputeSubnetwork({
networkRef: { name: network }, // Resolves to metadata.name of network
ipCidrRange: "10.0.0.0/24",
region: "us-central1",
});

Config Connector writes a resource’s status once it is ready, so a value such as a Cloud Run service’s URL never appears in the YAML you apply. Another lexicon or an output can still reference it. Each scalar field of a CRD’s status is an attribute, with dots read as underscores:

export const web = new CloudRunService({ /* ... */ });
web.status_uri; // status.uri
web.status_latestReadyRevision;

Nested and list fields, such as status.conditions, are not attributes.

Set a member’s project once in its chant.config.ts:

export default { lexicons: ["gcp"], gcp: { project: "my-project" } };

The build writes it as every resource’s cnrm.cloud.google.com/project-id annotation and resolves GCP.ProjectId from it, so apply and the live reads find the same project. It reaches the build as config data, so it also holds under --sandbox.

You can also bind resources to a GCP project via annotations:

import { defaultAnnotations, GCP } from "@intentius/chant-lexicon-gcp";
export const annotations = defaultAnnotations({
"cnrm.cloud.google.com/project-id": GCP.ProjectId,
});

This injects the project annotation into every resource. Without it, Config Connector uses the namespace’s default project.

GCP.ProjectId is read from gcp.project in chant.config, else GCP_PROJECT_ID, and GCP.Region and GCP.Zone from GCP_REGION and GCP_ZONE, at build. Config Connector YAML has no parameters, so a pseudo-parameter in a resource’s spec, such as CloudRunServiceComposite’s default location and projectRef, must resolve: a build with the variable unset fails and names each resource and variable. Set the variable, or pass the value explicitly.

gcpApply and the live reads (observe, health, drift) take a resource’s project from its own spec.projectRef.external (an id or projects/<id>), then the project annotation, which is where gcp.project lands, then GCP_PROJECT_ID, then GOOGLE_CLOUD_PROJECT.

The live reads also resolve a reference to another resource the way the build does: neg.name is the target’s metadata.name, or its logical id in kebab case when it sets none.

Config Connector resources go through a reconciliation lifecycle:

Config Connector state machine: YAML applied to kubectl, then Pending → Reconciling → UpToDate, UpdateFailed, or DependencyNotReady with retry paths
Config Connector reconciliation lifecycle
StatusMeaning
UpToDateResource matches desired state
UpdatingController is applying changes
UpdateFailedGCP API returned an error
DependencyNotReadyWaiting for a referenced resource
DeletionFailedCannot delete the GCP resource

Check status with: kubectl get gcp -A or kubectl describe <resource>

Use defaultLabels() and defaultAnnotations() to inject metadata into all resources:

import { defaultLabels, defaultAnnotations } from "@intentius/chant-lexicon-gcp";
export const labels = defaultLabels({
"app.kubernetes.io/managed-by": "chant",
"env": "production",
});

Explicit labels on individual resources take precedence over defaults.

Config Connector YAML has no outputs section. output() is exported so a gcp attribute can be named as an output, but the build can’t write its value: a field such as status.uri exists only after the resource is applied. The build prints a warning for each such output instead of dropping it. Read the value from the live resource.

chant