Create Harbor projects

In Harbor, a project serves as a logical unit for organizing and managing a collection of container images. It provides a way to group related artifacts together and apply specific policies, access controls, and replication rules to the entire collection. Images cannot be pushed or pulled to Harbor before a project is created.

Before you begin

To create Harbor projects, you must have the necessary identity and access roles:

  • Harbor Project Creator: has access to manage the HarborInstanceProject resource in their project. Ask your Organization IAM Admin to grant you the Harbor Project Creator (harbor-project-creator) role.
  • Before creating Harbor projects, you must sign in to the Harbor UI first for Harbor to recognize your identity. If this step is missed, the Harbor project creation might be stuck with a false positive in the GDC console.

Create a Harbor project

Create a Harbor project using the GDC console or the gdcloud CLI.

Console

In the GDC console, follow these steps:

  1. Click the Harbor Container Registry link in the section CI/CD in the navigation menu.
  2. Click Create a Harbor project.
  3. Enter the name of the project and click Create.
  4. A confirmation message appears stating your project is created successfully.
  5. After your Harbor project is created, sign in to the Harbor UI to confirm that you can view the Harbor project.

CLI

Create the Harbor project:

  gdcloud harbor harbor-projects create HARBOR_PROJECT \
    --project=PROJECT \
    --instance=INSTANCE

Replace the following:

  • HARBOR_PROJECT: the name of the Harbor project to create.
  • PROJECT: the name of the GDC project.
  • INSTANCE: the name of the instance.