Create a project

Create a project to group your resources together within an organization, providing a lifecycle and policy boundary for your resources.

Before you begin

To get the permissions needed to create a project, ask your Organization IAM Admin to grant you the Project Creator role (project-creator).

Before you create a project, review the information Google Distributed Cloud (GDC) air-gapped uses to identify your project:

  • Project name: A human-readable name for your project.

    The project name isn't used by any GDC APIs. You can edit the project name at any time during or after project creation. Project names don't need to be unique.

    Projects have the following name requirements:

    • 4 to 30 characters in length.
    • Contains letters, numbers, single quotes, hyphens, spaces, or exclamation points.
  • Project ID: A globally unique identifier for your project.

    A project ID is a unique string used to differentiate your project from all others in GDC. You can only modify the project ID when you're creating the project.

    Project IDs have the following requirements:

    • 6 to 30 characters in length.
    • Contains lowercase letters, numbers, and hyphens.
    • Starts with a letter.
    • Must not start with the prefix g-, such as g-project.
    • Must not end with a hyphen.
    • Must not end with the string -cluster or -system. The -system suffix is reserved for projects created by GDC.
    • Must not be in use or previously used; this includes deleted projects.

Don't include sensitive information in your project name, project ID, or other resource names. The project ID is used in the name of many other GDC resources, and any reference to the project or related resources exposes the project ID and resource name.

Create a new project

You can create a project to provide logical grouping of service resources. For example, you can create separate projects to hold resources for development, test, and production environments.

To get the permissions that you need to create a project, ask your Organization IAM Admin to grant you the Project Creator role. For more information on granting permissions, see the Assign a role binding to the service identity section.

Console

To create a new project using the GDC console, complete the following steps:

  1. In the navigation menu, click Projects.
  2. Click Add project.
  3. In the Project name field, enter a project name.

  4. Click Next.

  5. Select the existing clusters to attach to the project. Click Next.

  6. Optional: Configure your project's networking capabilities. Clear the Enable data exfiltration protection checkbox to disable all egress traffic to other projects inside your organization.

  7. Click Next.

  8. In the Review section, review the summary and click Create.

  9. To verify the new project is available, a message is displayed in the console: Project PROJECT_NAME successfully created.

  10. Link your new project with a billing account. To track project resource costs, you must have an associated billing account linked to your project.

gdcloud

To create a new project using the gdcloud CLI, complete the following steps:

  1. Ensure you have the gdcloud CLI installed. For more information, see the gdcloud CLI Overview page.

  2. To create a project, run:

    gdcloud projects create PROJECT_ID
    

    Replace PROJECT_ID with the unique identifier for your new project.

  3. To verify the new project is available, run:

    gdcloud projects list
    
  4. Link your new project with a billing account. To track project resource costs, you must have an associated billing account linked to your project.

API

To create a new project using the API directly, complete the following steps:

  1. Set an environment variable for the org admin cluster kubeconfig file:

    export KUBECONFIG=ORG_ADMIN_CLUSTER_KUBECONFIG_PATH
    

    If you don't have the org admin cluster kubeconfig file, generate one.

  2. Create and apply the Project custom resource:

    kubectl apply -f --kubeconfig=${KUBECONFIG} - <<EOF
    apiVersion: resourcemanager.gdc.goog/v1
    kind: Project
    metadata:
      namespace: platform
      name: PROJECT_ID
    EOF
    

    Replace PROJECT_ID with the unique identifier for your new project.

  3. Verify the new project is available:

    kubectl --kubeconfig=${KUBECONFIG} get namespaces
    
  4. Link your new project with a billing account. To track project resource costs, you must have an associated billing account linked to your project.

Terraform

To create a new project using Terraform, complete the following steps:

  1. In a Terraform configuration file, insert the following code snippet:

    provider "kubernetes" {
      config_path = "ORG_ADMIN_CLUSTER_KUBECONFIG"
    }
    

    Replace ORG_ADMIN_CLUSTER_KUBECONFIG with the path to the org admin cluster kubeconfig file. If you don't have the org admin cluster kubeconfig file, generate one.

  2. In a Terraform configuration file, such as main.tf, insert the following code snippet:

    resource "kubernetes_manifest" "project-create" {
      manifest = {
        "apiVersion" = "resourcemanager.gdc.goog/v1"
        "kind" = "Project"
        "metadata" = {
          "name" = "PROJECT_ID"
          "namespace" = "platform"
        }
      }
    }
    

    Replace the following:

    • ORG_ADMIN_CLUSTER_KUBECONFIG: the path to the org admin cluster kubeconfig file.
    • PROJECT_ID: the unique identifier for your new project.
  3. Apply the new project using Terraform:

    terraform apply
    
  4. Link your new project with a billing account. To track project resource costs, you must have an associated billing account linked to your project.