Getting Started
What is chant?
Section titled “What is chant?”Chant is a TypeScript-to-YAML compiler. You write typed TypeScript declarations, and chant outputs Config Connector YAML manifests that can be applied to a GKE cluster with Config Connector installed.
Prerequisites
Section titled “Prerequisites”- A GKE cluster with Config Connector installed
- A
ConfigConnectorContextresource configured per namespace - A GCP Service Account bound to the Config Connector controller
Install
Section titled “Install”npm install --save-dev @intentius/chant @intentius/chant-lexicon-gcpYour first resource
Section titled “Your first resource”The fastest path is the GcsBucket composite — one function call that produces a properly configured Storage bucket:
import { GcsBucket } from "@intentius/chant-lexicon-gcp";import { defaultAnnotations, GCP } from "@intentius/chant-lexicon-gcp";
export const annotations = defaultAnnotations({ "cnrm.cloud.google.com/project-id": GCP.ProjectId,});
const { bucket } = GcsBucket({ name: "my-data-bucket", location: "US", versioning: true,});
export { bucket };Build and deploy
Section titled “Build and deploy”# Generate Config Connector YAMLchant build --output dist/manifests.yaml
# Validate against the cluster API (no changes applied)kubectl apply -f dist/manifests.yaml --dry-run=server
# Applykubectl apply -f dist/manifests.yamlUsing resource constructors
Section titled “Using resource constructors”import { StorageBucket, IAMPolicyMember, GCP } from "@intentius/chant-lexicon-gcp";
export const bucket = new StorageBucket({ location: "US", storageClass: "STANDARD", uniformBucketLevelAccess: true, versioning: { enabled: true },});
export const reader = new IAMPolicyMember({ member: "serviceAccount:app@my-project.iam.gserviceaccount.com", role: "roles/storage.objectViewer", resourceRef: { apiVersion: "storage.cnrm.cloud.google.com/v1beta1", kind: "StorageBucket", name: bucket, },});Next steps
Section titled “Next steps”- Config Connector Concepts — resource structure, references, project binding
- Examples — StorageBucket, ComputeInstance, CloudSQL, IAM
- Lint Rules — built-in checks for security and best practices