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®.
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 to update 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_ui
section to the cluster description. In this section, provide theenabled
parameter 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 validate
Terraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform plan
If 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 the Terraform provider documentation
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 put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.update method and send the following request, e.g., via cURL
: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
updateMask
parameter 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
: List of parameters to update as a single string, separated by commas. SpecifyconfigSpec.kafkaUiConfig.enabled
to update the setting for enabling Kafka UI.configSpec.kafkaUiConfig.enabled
: Set totrue
to enable Kafka UI.
You can request the cluster ID with the list of clusters in the folder.
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, 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_mask
parameter 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.Update
Where:
update_mask
: List of parameters to update as an array ofpaths[]
strings. Specifyconfig_spec.kafka_ui_config.enabled
to update the setting for enabling Kafka UI.config_spec.kafka_ui_config.enabled
: Set totrue
to enable Kafka UI.
You can request the cluster ID with the list of clusters in the folder.
-
View the server response to make sure the request was successful.
Getting a link to the web interface
- In the management console
, open the cluster page. - Go to the Kafka UI page.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.get method and send the following request, e.g., via cURL
: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.
-
View the server response to make sure the request was successful.
You can find the link to the Apache Kafka® web interface in the
config.kafkaUiConfig.url
parameter.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, 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.Get
You can request the cluster ID with the list of clusters in the folder.
-
View the server response to make sure the request was successful.
You can find the link to Kafka UI in the
config.kafka_ui_config.url
parameter.