- Read-only - cost estimates and cluster discovery only. Ankra never modifies resources.
- GKE provisioning - everything read-only does, plus creating and managing GKE clusters.
What Ankra Accesses
For cost estimation and discovery, Ankra calls three Google APIs with the service account, all read-only:
Provisioning GKE additionally uses:
Before you start
- A role in Ankra with
credentials.write(the built-inownerandadminroles have it). See Credentials. - Permission in the Google Cloud project to enable APIs, create service accounts and keys, and grant IAM roles.
Creating a GCP Credential
Pick the tab that matches what you want the credential to do. Each flow is complete - follow one from top to bottom.- Read-only (cost and discovery)
- GKE provisioning
Grants the Viewer role (The downloaded JSON must contain
roles/viewer) only. Ankra can price your nodes and discover clusters, but cannot create or change anything.1
Enable the required APIs
In the Google Cloud Console, select your project and enable the Cloud Resource Manager API, Cloud Billing API, and Compute Engine API.Or with the
gcloud CLI:2
Create a read-only service account
- Go to IAM & Admin → Service Accounts → Create service account
- Give it a name such as
ankra-cost-readonly - Grant it the Viewer role (
roles/viewer) on the project - or a custom read-only role
gcloud (reusing the PROJECT_ID from the previous step):3
Create and download a JSON key
- Open the service account → Keys → Add key → Create new key
- Choose JSON and download the file
gcloud:client_email, private_key, and token_uri.4
Add it to Ankra
Go to Integrations & alerts → Credentials, click Add credential, and under Cloud providers choose Google Cloud (GCP). Enter:
- Name: 3 to 100 lowercase letters, digits and single hyphens (for example
gcp-prod). It cannot change later. - Project ID: your GCP project ID (for example
acme-prod) - Service account key (JSON): paste the full contents of the downloaded key file
Already added a read-only credential and want to provision GKE? Grant the extra roles and enable the Kubernetes Engine API on the same service account (run the
add-iam-policy-binding and services enable commands from the GKE provisioning tab with your existing account’s name) - no need to create a new credential in Ankra.Replace the key
Create a new JSON key on the same service account, then open the credential in Ankra, click Settings & access, paste the file into New service account key (JSON) under Replace the secret, and click Check and replace. Ankra checks the new key with Google Cloud before it stores it; when you see The secret is replaced, delete the old key in Google Cloud. The project ID stays fixed, and the key is write-only: Stored values never shows it. See Replace the secret.Troubleshooting GCP Credentials
Forgcloud setup errors during service-account creation (such as does not have permission ... (or it may not exist)), see the warning in the service-account step above - it’s almost always an unsubstituted PROJECT_ID placeholder or a missing setIamPolicy permission.
These are the answers Test the connection and Check now give:
The check only verifies read access. If the credential saves fine but GKE cluster creation fails with a permissions error, the service account is missing
roles/container.admin or roles/iam.serviceAccountUser, or the Kubernetes Engine API is not enabled - see the GKE provisioning tab above.
Creating a VPC network from the cluster wizard fails with Required 'compute.networks.create' permission when the service account lacks Compute Network Admin (roles/compute.networkAdmin) - grant it with the optional binding from the GKE provisioning tab, or pick an existing network instead.