Google Container Registry

Introduction

Bunnyshell supports connecting Google Container Registries to your organization, allowing you to use those registries to store your container images and deploy them on Kubernetes clusters.

šŸš§

Before you proceed, make sure you have administrator privileges on your Google Container Registry.

Ā 

Grant Bunnyshell Access to GCR

  1. Install the gcloud CLI using the instructions available here.

  2. Enable Google Container Registry API using the command below.

gcloud services enable containerregistry.googleapis.com

Create the Service Account

  1. Now you'll have to grant Bunnyshell access to GCR. Start by creating a service account using the command below:
gcloud iam service-accounts create {USER}

Example

gcloud iam service-accounts create bunnyshell-access

šŸ“˜

In this case, bunnyshell-access is the GCR User ID we used.

  1. Grant the Service Account access to your storage:
gcloud projects add-iam-policy-binding {PROJECT_ID} \
    --member=serviceAccount:{USER}@{PROJECT_ID}.iam.gserviceaccount.com \
    --role=roles/storage.admin

Example

gcloud projects add-iam-policy-binding bunnyshell-84194 \
    --member=serviceAccount:[email protected] \
    --role=roles/storage.admin

šŸ“˜

Note

In this case, bunnyshell-84194 is our GCR Project ID.

Retrieve your Project ID

The Project ID can be fetched by clicking on the {Project Name} in the top bar.

Retrieve the Google Service Account

  1. Retrieve the Google Service Account key using the command below:
gcloud iam service-accounts keys create gsa-key.json \
    --iam-account={USER}@{PROJECT_ID}.iam.gserviceaccount.com

Example

gcloud iam service-accounts keys create gsa-key.json \
    --iam-account=bunnyshell-access@bunnyshell-84194.iam.gserviceaccount.com

Ā 

Connect your GCR Registry

  1. Access the Bunnyshell interface and click the Integrations button on the left side.

  1. Click Container Registries on the left-side menu.

  2. Click the Connect container registry button and select Google Container Registry.

  3. A new window will pop-up, where you will have to provide the following information:

  • Registry name: Choose what name your cluster will have in Bunnyshell.
  • Region: The location of the registry, location where the image is stored. More details about GCR regions are available on the Google Cloud documentation site.
  • GCR User ID: Copy and paste the Google Service Account ID in this field.

šŸ“˜

Note

If you have a Google Service Account already created, the ID is the string before the @ in the email address.

Example:
In the address [email protected], the string bunnyshell-access is the Google Service Account ID.