Namespaces and Google Cloud projects

Config Connector creates Google Cloud resources using Kubernetes configuration. These resources are organized in Kubernetes Namespaces.

How Config Connector uses Namespaces

Config Connector can use the annotations on the resource's Namespace to determine what project, folder, or organization to create the resources in. The Namespace's annotation will only be applied if the resource configuration does not already specify where to create the resource. For more information, see Organizing resources with projects and folders

For example, if you want to create a Cloud Spanner Instance with a name of mySpanner in your project with a project ID of myProject then run this command to annotate your namespace, replacing [NAMESPACE_NAME] with your Namespace name:

kubectl annotate namespace \
 [NAMESPACE_NAME] cnrm.cloud.google.com/project-id="myProject"

Then, create a Config Connector SpannerInstance with a name of mySpanner in your namespace. Config Connector will create a corresponding Cloud Spanner in your specified Google Cloud project, based on the configured namespace annotation.

Using Namespaces with folders and organizations

Google Cloud supports organizing resources at the Project, Folder, and Organization levels. You can add Annotations to your Config Connector Namespaces to map resources to a Folder or Organization.

To learn more, see Organizing resources with projects, folders, or organizations.