Provisioning GKE requires the Kubernetes Engine Admin (
roles/container.admin) and Service Account User (roles/iam.serviceAccountUser) roles and the Kubernetes Engine API enabled - broader than the read-only cost scope. See Google Kubernetes Engine (GKE).What Ankra Accesses
For cost estimation, Ankra calls three Google APIs with the service account, all read-only:| API | Why it’s used |
|---|---|
| Cloud Resource Manager API | Verify the service account can read the project (the Test connection check) |
| Cloud Billing API | Read the public Compute Engine price catalog (SKUs) for cost estimates |
| Compute Engine API | Read machine-type specs (vCPU and memory) to price your nodes |
Creating a GCP Credential
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: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):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.Add to Ankra (UI)
Go to Credentials → Add → Google Cloud (GCP), then provide:
- Name: a unique identifier - lowercase letters and numbers only, cannot start with a hyphen (e.g.
gcp-prod) - Project ID: your GCP project ID (e.g.
acme-prod) - Service Account Key (JSON): paste the full contents of the downloaded key file
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 Create a read-only service account step above - it’s almost always an unsubstituted PROJECT_ID placeholder or a missing setIamPolicy permission.
The table below covers the Test connection result in the Ankra UI:
| Test connection result | Cause | Solution |
|---|---|---|
| The service account key is not valid JSON or is missing required fields | The pasted key isn’t the full JSON file | Paste the entire downloaded JSON; it must include client_email, private_key, and token_uri |
| Google rejected the service account credentials | The key is disabled or deleted | Confirm the key is active, or create a new JSON key |
| The service account lacks read access to this project | Missing IAM role or disabled API | Grant the Viewer role and enable the Cloud Resource Manager API |
| The project was not found | Wrong project ID | Check the Project ID matches your GCP project exactly |
| Could not reach the GCP Resource Manager API | Network or connectivity issue | Retry; ensure outbound access to *.googleapis.com |