Config Connector Concepts
Every exported resource declaration becomes a Config Connector manifest document in the generated YAML.
Resource structure
Section titled “Resource structure”Every Config Connector resource has four standard fields:
| Field | Source | Example |
|---|---|---|
apiVersion | Resolved from resource type | storage.cnrm.cloud.google.com/v1beta1 |
kind | Resolved from resource type | StorageBucket |
metadata | From metadata property | { name: "my-bucket", labels: {...} } |
spec | From remaining props | Resource-specific configuration |
Resource references
Section titled “Resource references”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-networkIn 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",});Project binding
Section titled “Project binding”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.
Reconciliation lifecycle
Section titled “Reconciliation lifecycle”Config Connector resources go through a reconciliation lifecycle:
| Status | Meaning |
|---|---|
| UpToDate | Resource matches desired state |
| Updating | Controller is applying changes |
| UpdateFailed | GCP API returned an error |
| DependencyNotReady | Waiting for a referenced resource |
| DeletionFailed | Cannot delete the GCP resource |
Check status with: kubectl get gcp -A or kubectl describe <resource>
Default labels and annotations
Section titled “Default labels and annotations”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.