Google GCR
This guide outlines the steps to deploy a Docker image from Google Container Registry (GCR) to Exopods.
Last updated
This guide outlines the steps to deploy a Docker image from Google Container Registry (GCR) to Exopods.
Last updated
Kubernetes cluster: A Kubernetes cluster where you want to deploy your application.
Google Cloud account: A Google Cloud account with necessary permissions to access your GCR repository.
Exopods account: An Exopods account.
Docker image: A Docker image built from your application code and pushed to your GCR repository.
Basic understanding of Kubernetes and Docker: Familiarity with Kubernetes concepts and Docker images is helpful.
GCP credentials: A service account key or username and password for your Google Cloud account.
To get Google Cloud Platform (GCP) credentials for your Google Container Registry (GCR) repository, you can follow these steps:
1. Create a Service Account Key:
Log in to the Google Cloud Console ()
Go to the IAM & Admin section and select "Service accounts".
Click "Create Service Account".
Give your service account a name (e.g., "gcr-access").
Grant the service account the "Cloud Container Registry" role.
Click "Create".
Click on the newly created service account.
Go to the "Keys" tab and click "Add key".
Select "Create new key".
Choose a file name for your service account key (e.g., "gcr-service-account.json").
Click "Create".
Download the JSON file. Keep this file secure, as it contains your service account credentials.
2. Use the Service Account Key:
You can use the downloaded JSON file as your "service account key" when configuring your Exopods deployment.
Deployment Name: Provide a unique name for your deployment.
Docker Repo/Registry URL:
Enter the URL of your GCR repository. This usually follows the format:
gcr.io/project-id/repo-name
.
Image Tag:
Enter the image tag (e.g., latest
, or any other version tag of your image).
Toggle the Private Registry option to enable pulling from a private Google Cloud Registry (GCR).
Select Secret: Choose GCR from the dropdown under the "Select Secret" option.
Add New Secret: If no GCR credentials are stored yet, click Add new and perform the following:
Registry Provider: Select GCR.
Secret Name: Provide a custom name for the secret (e.g., GCR_Pull_Secret
).
Repo URL: Provide the URL of your GCR repository.
Username: Enter _json_key
for GCR.
Email: This field is optional for GCR.
Password: Paste the base64-encoded service account key JSON.
Submit Secret: Once the secret is filled, click Submit to add the pull secret for GCR.
Test Connection: After the secrets are configured, click Test to verify the connection with your GCR repository.
Registry Provider Selection: Select the Registry Provider as GCR from the list.
Repo URL, Username, Email, Password: Confirm and re-enter the following details if necessary:
Repo URL (your GCR URL)
Username: _json_key
Email (optional)
Password (service account key)
Continue: If the test is successful, click Continue to finalize the Docker image configuration.
Once the Docker image is successfully configured, proceed to the deployment settings.
Configure Deployment Details:
Port Mapping: Define the ports required for your application.
Command and Arguments: Set custom Docker commands and arguments (if any) to run when the container starts.
Environment Variables: Specify any environment variables needed for the container's runtime.
Pricing/Resource Allocation: Configure the resource allocation (e.g., CPU, RAM) and select a pricing tier that suits your deployment.
Once all configurations are in place, click Deploy to launch your containerized application from GCR. The system will now pull the Docker image from the private Google Cloud Registry and deploy it.
By completing these steps, you've successfully configured a Docker image from Google Cloud Registry (GCR) and deployed it. After reviewing your resource allocation and pricing, the deployment is now live. This guide provides a clear, beginner-friendly approach to deploying containerized applications with GCR, while also allowing for more advanced configurations as your understanding deepens.