Skip to content

Config Connector Concepts

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",
});

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.

Config Connector resources go through a 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.