To view a cluster, you can use the Google Cloud console, the Google Cloud CLI, the client library, or the Managed Kafka API. You can't use the open source Apache Kafka API to view a cluster.
Required roles and permissions to view a cluster
To get the permissions that you need to view a cluster,
ask your administrator to grant you the
Managed Kafka Viewer (roles/managedkafka.viewer
) IAM role on your project.
For more information about granting roles, see Manage access to projects, folders, and organizations.
This predefined role contains the permissions required to view a cluster. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to view a cluster:
-
List clusters:
managedkafka.clusters.list
-
Get cluster details:
managedkafka.clusters.get
You might also be able to get these permissions with custom roles or other predefined roles.
For more information about the Managed Kafka Viewer role, see Managed Service for Apache Kafka predefined roles.
View a cluster
To view a cluster, follow these steps:
Console
-
In the Google Cloud console, go to the Cluster page.
The clusters you created in a project are listed.
- To view a specific cluster, click a cluster name.
- The cluster details page opens. This page has the following tabs:
- Resources: Displays the list of topics and consumer groups associated with the cluster.
- Configurations: Displays the configuration of the cluster, including the list of subnets associated with the cluster.
- Monitoring: Displays the monitoring alerts associated with the cluster.
- Logs: Displays the logs related to clusters from Logs Explorer.
gcloud
-
In the Google Cloud console, activate Cloud Shell.
At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.
Run the
gcloud managed-kafka clusters describe
command:gcloud managed-kafka clusters describe CLUSTER_ID \ --location=LOCATION
Replace the following:
CLUSTER_ID: The ID or name of the cluster.
LOCATION: The location of the cluster.
Go
Before trying this sample, follow the Go setup instructions in Install the client libraries. For more information, see the Managed Service for Apache Kafka Go API reference documentation.
To authenticate to Managed Service for Apache Kafka, set up Application Default Credentials(ADC). For more information, see Set up ADC for a local development environment.
Java
Before trying this sample, follow the Java setup instructions in Install the client libraries. For more information, see the Managed Service for Apache Kafka Java API reference documentation.
To authenticate to Managed Service for Apache Kafka, set up Application Default Credentials. For more information, see Set up ADC for a local development environment.
Python
Before trying this sample, follow the Python setup instructions in Install the client libraries. For more information, see the Managed Service for Apache Kafka Python API reference documentation.
To authenticate to Managed Service for Apache Kafka, set up Application Default Credentials. For more information, see Set up ADC for a local development environment.