Service account roles for a Google cloud credential
Grant the service account of a Google cloud credential only the predefined roles that your deployment uses, instead of the Owner or Editor role on the project.
Cloudera recommends granting the service account only the predefined roles that your deployment uses, instead of the Owner or Editor role on the project. The Owner or Editor role works, but it grants far broader access than Cloudera Cloud Factory needs, and the credential uses a static service account key. Grant each role in the following tables on the resource that the Where to grant it column lists.
Domain Name System (DNS) uses a separate DNS credential, not the service account of the Google cloud credential.
Roles in the service project
Grant the following roles on the service project, which is the project in which the clusters run.
| Role | Where to grant it | When it is required | Purpose |
|---|---|---|---|
roles/compute.instanceAdmin.v1 | Service project | Always | Lists regions, zones, machine types, disk types, and images, and creates, starts, stops, resets, and deletes the virtual machines (VMs) and disks of the clusters. |
roles/compute.loadBalancerAdmin | Service project | When you use Kubernetes Service objects of type LoadBalancer | Allows the cloud-controller-manager to create the load balancers for those Services. |
roles/compute.securityAdmin | Service project | When you do not use a Shared VPC network | Manages the firewall rules of the clusters. With a Shared VPC network, the firewall rules are on the host project. |
roles/iam.serviceAccountUser | Service project | Always | Attaches a service account to the cluster VMs. |
roles/serviceusage.serviceUsageViewer | Service project | Always | Checks that the required APIs are enabled in the project. |
Roles that depend on your configuration
Grant the following roles only when your deployment uses the feature that the table lists.
| Role | Where to grant it | When it is required | Purpose |
|---|---|---|---|
roles/compute.networkAdmin | Service project | When Cloudera Cloud Factory creates the VPC network, which means that VPC Import is turned off | Creates and manages the VPC network and its subnetworks. |
roles/file.viewer | Project that contains the Filestore instance | When projects share a Filestore file system | Lists the existing Filestore instances. Cloudera Cloud Factory does not create Filestore instances. |
roles/container.viewer | Project that contains the Google Kubernetes Engine (GKE) cluster | When you import an existing GKE cluster | Lists and reads the GKE clusters. |
roles/resourcemanager.projectCreator | Folder | When Cloudera Cloud Factory creates new projects in a folder | Creates the projects in which the clusters run. |
roles/resourcemanager.folderViewer | Folder | When Cloudera Cloud Factory creates new projects in a folder | Reads the folder when Cloudera Cloud Factory validates the credential. |
roles/serviceusage.serviceUsageAdmin | Folder | When Cloudera Cloud Factory creates new projects in a folder | Enables the required APIs on the new projects. |
When Cloudera Cloud Factory creates projects in a folder, it also deletes the projects that it created. By default, Google Cloud grants the creator of a project the Owner role on the new project, which covers the deletion.
Role on the billing account
| Role | Where to grant it | When it is required | Purpose |
|---|---|---|---|
roles/billing.user (Billing Account User) | Billing account | Always | Lists the billing accounts and links projects to the billing account. Cloudera Cloud Factory checks the billing.resourceAssociations.create permission on the billing account. |
Permissions for a custom role
If your security team requires a custom role, Cloudera Cloud Factory uses the following permissions to validate the credential and to load the regions, zones, machine types, disk types, images, and networks:
- compute.regions.get
- compute.regions.list
- compute.zones.list
- compute.machineTypes.get
- compute.machineTypes.list
- compute.diskTypes.list
- compute.images.get
- compute.images.getFromFamily
- compute.images.list
- compute.networks.get
- compute.networks.list
- compute.subnetworks.get
- compute.subnetworks.list
- resourcemanager.projects.get
- serviceusage.services.get
A custom role also needs the provisioning permissions that the predefined roles in the preceding tables grant, for example, the permissions to create VMs, disks, and firewall rules. After you create the custom role, verify that Cloudera Cloud Factory can load the machine types and create a cluster with it.
