Use Cases
- Artifact Registry: Pull container images from Google Artifact Registry
- Cloud Storage: Access files in Google Cloud Storage buckets
- BigQuery: Query data from BigQuery datasets
- Pub/Sub: Publish and subscribe to Pub/Sub topics
- Any GCP Service: Authenticate with any Google Cloud API
For Google Artifact Registry, you can also use a Docker secret with base64-encoded service account credentials. The GCP secret type is recommended for direct GCP API access.
Configuration Options
The GCP secret stores a complete service account JSON key file:Create a GCP Secret
- Console UI
- CLI
- Terraform
- Pulumi
1
Navigate to Secrets
In the Console, navigate to Secrets and click New, or use the Create dropdown in the top-right corner and select Secret.
2
Enter basic information
Enter a Name and optional Description.
3
Select secret type
Select GCP as the secret type.
4
Configure credentials
Click Data in the left pane. Drag and drop your service account JSON file, or click to import.
5
Create the secret
Click Create.
Best Practices
Use least-privilege service accounts
Use least-privilege service accounts
Create dedicated service accounts with only the IAM roles your workload needs. Avoid using default service accounts or overly permissive roles.
Rotate keys regularly
Rotate keys regularly
Set up a key rotation schedule. Delete old keys after deploying new ones to Control Plane.
Use Workload Identity where possible
Use Workload Identity where possible
For GKE deployments, consider using Workload Identity instead of service account keys.
Using for Artifact Registry
To use a GCP secret for pulling images from Artifact Registry, add it as a pull secret to your GVC:- Console UI
- CLI
- Terraform
- Pulumi
1
Navigate to your GVC
Open your GVC in the Console.
2
Open Pull Secrets
Click Pull Secrets in the left pane.
3
Add the secret
Click Add and select your GCP secret.
4
Save changes
Click Save.
The service account must have the
roles/artifactregistry.reader role on the Artifact Registry repository.Next Steps
Using Secrets in Workloads
Learn how to grant access and inject secrets
GCP Cloud Account
Set up GCP cloud account integration