# Namespaces and Google Cloud projects

# Namespaces and Google Cloud projects

Config Connector creates Google Cloud resources
using Kubernetes configuration. These resources are organized in
[Kubernetes Namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/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](https://docs.cloud.google.com/config-connector/docs/how-to/organizing-resources/overview)

For example, if you want to create a Cloud SQL Instance with a name of
`mySQL` in your project with a project ID of `myProject`, then run this command to annotate your namespace:

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

Replace `NAMESPACE_NAME` with your Namespace name.

Then, create a Config Connector `SQLInstance` with a name of `mySQL` in
your namespace. Config Connector creates a corresponding Cloud SQL instance in your
specified Google Cloud project, based on the configured namespace annotation.

## Using Namespaces with projects, folders, and organizations

Google Cloud supports organizing resources at the
[Project, Folder, and Organization](https://docs.cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy#resource-hierarchy-detail)
levels. You can add Annotations to your Config Connector Namespaces to map
resources to a [Project](https://docs.cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy#projects), a [Folder](https://docs.cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy#folders) or
[Organization](https://docs.cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy#organizations).

To learn more, see
[Organizing resources with projects, folders, or organizations](https://docs.cloud.google.com/config-connector/docs/how-to/organizing-resources/overview).