Kafka UI for Apache Kafka®
To work with Managed Service for Apache Kafka® clusters, you can use Kafka UI. It will help you track data streams, troubleshoot issues, manage brokers, your cluster, producers and consumers. To learn more about its features, see Kafka UI for Apache Kafka®.
To grant access to the Kafka UI web interface, assign the Yandex Cloud account the following roles for the folder where the Apache Kafka® cluster was created:
- managed-kafka.interfaceUser: To work with the Kafka UI web interface.
- managed-kafka.viewer: To view the Apache Kafka® cluster information.
- resource-manager.viewer: To view information about the cloud and folder in which the Apache Kafka® cluster was created.
Enabling the web interface
- Navigate to the folder dashboard
and select Managed Service for Kafka. - In the cluster row, click
, then select Edit. - Enable Kafka UI.
- Click Save.
- Go to the Kafka UI page.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
View the description of the CLI command for updating a cluster:
yc managed-kafka cluster update --help -
Enable the Apache Kafka® web interface on your cluster using
--kafka-ui-enabled:yc managed-kafka cluster update <cluster_name_or_ID> \ --kafka-ui-enabled=true
To find out the cluster name or ID, get a list of clusters in the folder.
-
Open the current Terraform configuration file that defines your infrastructure.
For more information about creating this file, see Creating clusters.
-
To enable the Apache Kafka® web interface, add a
config.kafka_uisection to the cluster description. In this section, provide theenabledparameter set totrue:resource "yandex_mdb_kafka_cluster" "<cluster name>" { ... config { ... kafka_ui { enabled = true } } } -
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply -
Confirm updating the resources.
-
Wait for the operation to complete.
-
-
For more information, see this Terraform provider guide.
Time limits
The Terraform provider limits the amount of time for all Managed Service for Apache Kafka® cluster operations to complete to 60 minutes.
Operations exceeding the set timeout are interrupted.
How do I change these limits?
Add the timeouts block to the cluster description, for example:
resource "yandex_mdb_kafka_cluster" "<cluster_name>" {
...
timeouts {
create = "1h30m" # 1 hour 30 minutes
update = "2h" # 2 hours
delete = "30m" # 30 minutes
}
}
-
Get an IAM token for API authentication and save it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Cluster.update method, e.g., via the following cURL
request:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMaskparameter as a single comma-separated string.curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-kafka/v1/clusters/<cluster_ID>' \ --data '{ "updateMask": "configSpec.kafkaUiConfig.enabled", "configSpec": { "kafkaUiConfig": { "enabled": true } } }'Where:
updateMask: Comma-separated list of settings you want to update. SpecifyconfigSpec.kafkaUiConfig.enabledto update the setting for enabling Kafka UI.configSpec.kafkaUiConfig.enabled: Set totrueto enable Kafka UI.
You can request the cluster ID with the list of clusters in the folder.
-
Check the server response to make sure your request was successful.
-
Get an IAM token for API authentication and set it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume the repository contents are stored in the
~/cloudapi/directory. -
Use the ClusterService/Update call and send the following request, e.g., via gRPCurl
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_maskparameter as an array ofpaths[]strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/kafka/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "update_mask": { "paths": [ "config_spec.kafka_ui_config.enabled" ] }, "config_spec": { "kafka_ui_config": { "enabled": true } } }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.kafka.v1.ClusterService.UpdateWhere:
update_mask: List of settings you want to update as an array of strings (paths[]). Specifyconfig_spec.kafka_ui_config.enabledto update the setting for enabling Kafka UI.config_spec.kafka_ui_config.enabled: Set totrueto enable Kafka UI.
You can request the cluster ID with the list of clusters in the folder.
-
Check the server response to make sure your request was successful.
Getting a link to the web interface
- In the management console
, open the cluster page. - Go to the Kafka UI page.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
yc managed-kafka cluster get <cluster_name_or_ID>
You can find the link to Kafka UI in the kafka_ui.url parameter.
You can get the cluster ID and name with the list of clusters in the folder.
-
Get an IAM token for API authentication and set it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Cluster.get method, e.g., via the following cURL
request:curl \ --request GET \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-kafka/v1/clusters/<cluster_ID>'You can request the cluster ID with the list of clusters in the folder.
-
Check the server response to make sure your request was successful.
You can find the link to the Apache Kafka® web interface in the
config.kafkaUiConfig.urlparameter.
-
Get an IAM token for API authentication and set it as an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume the repository contents are stored in the
~/cloudapi/directory. -
Use the ClusterService/Get call and send the following request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/kafka/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.kafka.v1.ClusterService.GetYou can request the cluster ID with the list of clusters in the folder.
-
Check the server response to make sure your request was successful.
You can find the link to Kafka UI in the
config.kafka_ui_config.urlparameter.