AI Platform Pipelines depends on Identity and Access Management (IAM) roles to authorize users, groups, and services when machine learning (ML) pipelines access Google Cloud resources.
This document describes the roles required to:
- Set up AI Platform Pipelines.
- Run AI Platform Pipelines with a user-managed service account.
- Access AI Platform Pipelines as a user.
Learn more about IAM concepts and how IAM works.
Roles required to set up AI Platform Pipelines
To deploy AI Platform Pipelines, you must be granted the Viewer (roles/viewer
)
and Kubernetes Engine Admin (roles/container.admin
) roles on the project.
The Viewer role provides read access to all resources within a project. The
Kubernetes Engine Admin role provides full access to Kubernetes clusters and
Kubernetes API objects.
To follow the principle of least privilege, set up your AI Platform Pipelines
cluster to use granular access. To set up your
cluster with granular access, you must also be granted the Service Account
Admin (roles/iam.serviceAccountAdmin
) role on the project. The Service
Account Admin role provides access to create and configure IAM
service accounts.
Learn more about granting access to IAM roles.
Role | Permissions |
---|---|
Viewer (roles/viewer ) |
Permissions for read-only actions that do not affect state, such as viewing (but not modifying) existing resources or data within a project. |
Kubernetes Engine Admin( Provides access to full management of clusters and their Kubernetes API objects.
To set a service account on nodes, you must also have the Service Account User role
( Lowest-level resources where you can grant this role:
|
|
Service Account Admin( Create and manage service accounts. Lowest-level resources where you can grant this role:
|
|
Roles required to run AI Platform Pipelines with a user-managed service account
The Pods on a Google Kubernetes Engine (GKE) cluster
authenticate to Google Cloud using the GKE cluster's
service account. To make AI Platform Pipelines easier to set up and use,
GKE clusters created by AI Platform Pipelines use the default
Compute Engine service account with the
https://www.googleapis.com/auth/cloud-platform
access scope. This access
scope provides full access to the Google Cloud resources and APIs that you
have enabled in your project, which may provide the workloads on your cluster
excessive access to Google Cloud.
To assign granular permissions to the workloads that run on your AI Platform Pipelines cluster, create a service account for your cluster and grant this service account access to the following roles on the project:
- Monitoring Viewer: The Monitoring Viewer (
roles/monitoring.viewer
) role provides read access to monitoring data and configurations. - Monitoring Metric Writer: The Monitoring Metric Writer
(
roles/monitoring.metricWriter
) role provides write access so your cluster can write metrics. - Logs Writer: The Logs Writer (
roles/logging.logWriter
) role lets your cluster write log entries. - Storage Object Viewer: If you plan to create custom container images
for your pipelines that are stored in Container Registry, grant your
AI Platform Pipelines cluster access to the Storage Object Viewer
(
roles/storage.objectViewer
) role on the project.
You must also grant your service account access to any Google Cloud resources or APIs that your ML pipelines use.
- Configure your GKE cluster to use a user-managed service account.
- Learn more about IAM roles and managing service accounts.
Role | Title | Description | Permissions |
---|---|---|---|
Monitoring Viewer( Provides read-only access to get and list information about all monitoring data and configurations. Lowest-level resources where you can grant this role:
|
|
||
Monitoring Metric Writer( Provides write-only access to metrics. This provides exactly the permissions needed by the Cloud Monitoring agent and other systems that send metrics. Lowest-level resources where you can grant this role:
|
|
||
Logs Writer( Provides the permissions to write log entries. Lowest-level resources where you can grant this role:
|
|
||
Storage Object Viewer( Grants access to view objects and their metadata, excluding ACLs. Can also list the objects in a bucket. Lowest-level resources where you can grant this role:
|
|
Roles required to access AI Platform Pipelines as a user
To access an AI Platform Pipelines cluster, each user must be granted the
Kubernetes Engine Cluster Viewer (roles/container.clusterViewer
) role and
the Service Account User Role for the
Google Kubernetes Engine cluster's service account.
Role | Title | Description | Permissions |
---|---|---|---|
Kubernetes Engine Cluster Viewer( Provides access to get and list GKE clusters. |
|
Continue to the next section to learn how to grant users access to the Kubernetes Engine Cluster Viewer role and the Service Account User Role.
Grant a user access to AI Platform Pipelines
Use the following instructions to grant a user account access to your AI Platform Pipelines cluster.
Open AI Platform Pipelines in the Google Cloud console.
Find your AI Platform Pipelines cluster. Take note of the Cluster and Zone for use in subsequent steps.
Open a Cloud Shell session.
Cloud Shell opens in a frame at the bottom of the Google Cloud console. Use Cloud Shell to complete the rest of this process.
Run the following command to set the default Google Cloud project for this Cloud Shell session.
gcloud config set project PROJECT_ID
Replace PROJECT_ID with your Google Cloud project ID.
Run the following command to find the service account that your GKE cluster uses.
gcloud container clusters describe CLUSTER_NAME --zone ZONE \ --format="flattened(nodePools[].config.serviceAccount)"
Replace the following:
- CLUSTER_NAME: The name of your GKE cluster.
- ZONE: The zone that your cluster was created in.
The response might indicate that your cluster uses a service account named
default
. This value refers to the default service account for Compute Engine. Run the following command to find the full name of this service account.gcloud iam service-accounts list \ --filter "compute@developer.gserviceaccount.com"
Learn more about the Compute Engine default service account.
Grant your user account the Service Account User role on your GKE cluster's service account.
gcloud iam service-accounts add-iam-policy-binding \ SERVICE_ACCOUNT_NAME \ --member=user:USERNAME \ --role=roles/iam.serviceAccountUser
Replace the following:
- SERVICE_ACCOUNT_NAME: The name of your GKE cluster's service account, which you found in the previous step. Service account names are formatted like *@*.gserviceaccount.com.
- USERNAME: Your username on Google Cloud.
Grant your user account access to the GKE Cluster Viewer role on the project.
gcloud projects add-iam-policy-binding PROJECT_ID \ --member user:USERNAME --role roles/container.clusterViewer
Replace the following:
- PROJECT_ID: The ID of your Google Cloud project.
- USERNAME: Your username on Google Cloud.