Deploy from GCR to VideoSDK Cloud
This guide walks you through building, pushing, and deploying an agent container image stored in Google Container Registry (GCR) (or Artifact Registry) to VideoSDK Agent Cloud.
You will:
- Build your Docker image with the VideoSDK CLI.
- Push the image to Google Container Registry (or Artifact Registry).
- Create an image pull secret in VideoSDK Cloud for GCR.
- Deploy your agent using the GCR image and image pull secret.
Prerequisites
- A working agent project with a
Dockerfile. - Google Cloud project with GCR or Artifact Registry enabled.
gcloudCLI installed and configured.- VideoSDK CLI installed and authenticated.
1. Build Image with VideoSDK CLI
Use the videosdk agent build command to build your Docker image.
videosdk agent build \
--image gcr.io/my-project/my-agent:latest
Replace
my-projectwith your GCP project ID andmy-agentwith your repository name.
2. Push Image to GCR
Authenticate Docker with GCR and push the built image.
# Configure Docker to use gcloud as a credential helper
gcloud auth configure-docker gcr.io
# Push using VideoSDK CLI
videosdk agent push \
--image gcr.io/my-project/my-agent:latest \
--server gcr.io
3. Create Image Pull Secret for GCR
To allow VideoSDK Cloud to pull your private image, you need to create an image pull secret with your GCR credentials.
Obtaining GCR Credentials
GCR uses Service Account JSON Keys for authentication:
- Create a Service Account:
- Go to IAM & Admin > Service Accounts in the Google Cloud Console.
- Create a service account with the
Storage Object Viewer(orArtifact Registry Reader) role.
- Generate a JSON Key:
- Select the service account you created.
- Go to the Keys tab and click Add Key > Create new key.
- Select JSON and download the file (e.g.,
keyfile.json).
- Use it in the CLI:
- Username: Always use
_json_keyfor GCR. - Password: The content of your
keyfile.jsonfile.
- Username: Always use
Create the Secret
# Pass the JSON key file directly as the password
videosdk agent image-pull-secret my-gcr-secret \
--server https://gcr.io \
-u _json_key \
-p "$(cat keyfile.json)"
Ensure
keyfile.jsonis present in your current working directory. Use the full path if necessary. Replacehttps://gcr.iowith your regional GCR URL if applicable (e.g.,https://us.gcr.io).
4. Deploy Agent Using GCR Image
Now deploy your agent, referencing both the GCR image and the image pull secret you just created.
videosdk agent deploy \
--image gcr.io/my-project/my-agent:latest \
--image-pull-secret my-gcr-secret \
--min-replica 1 \
--max-replica 3
Your agent will now run on VideoSDK Cloud using the image stored in Google Container Registry.
Got a Question? Ask us on discord

