Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for Apache Kafka®
  • Getting started
    • All guides
      • Information about existing clusters
      • Creating a cluster
      • Updating cluster settings
      • Apache Kafka® version upgrade
      • Managing disk space
      • Stopping and starting a cluster
      • Getting a list of cluster hosts
      • Migrating hosts to a different availability zone
      • Deleting a cluster
    • Managing topics
    • Managing users
    • Managing connectors
  • Access management
  • Pricing policy
  • Terraform reference
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ

In this article:

  • Before a version upgrade
  • Upgrading a cluster
  • Examples
  1. Step-by-step guides
  2. Clusters
  3. Apache Kafka® version upgrade

Apache Kafka® version upgrade

Written by
Yandex Cloud
Updated at May 13, 2025
  • Before a version upgrade
  • Upgrading a cluster
  • Examples

Note

Starting March 1, 2025, support for Apache Kafka® 2.8, 3.0, 3.1, 3.2, and 3.3 is discontinued. You cannot create a cluster with these versions. We recommend that you upgrade your clusters to version 3.5.

You can upgrade a Managed Service for Apache Kafka® cluster to version 3.5 or lower. Upgrading to 3.6 or higher is not supported; however, you can create a cluster with one of these versions.

We recommend updating Apache Kafka® step by step without skipping any versions. For example, the upgrade sequence from version 3.1 to 3.5 is: 3.1 → 3.2 → 3.3 → 3.4 → 3.5.

To learn more about updates within a single version and host maintenance, see Maintenance.

Before a version upgradeBefore a version upgrade

Make sure this does not affect your applications: review the Apache Kafka® change log.

Upgrading a clusterUpgrading a cluster

Alert

Once upgraded, you cannot roll an Apache Kafka® cluster back to the previous version.

During an upgrade, topics may be unavailable if their replication factor is 1.

Management console
CLI
Terraform
REST API
gRPC API
  1. Navigate to the folder dashboard and select Managed Service for Kafka.
  2. In the cluster row, click , then select Edit.
  3. In the Version field, select a new version number.
  4. Click Save.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. Get a list of your Managed Service for Apache Kafka® clusters:

    yc managed-kafka cluster list
    
  2. Get information about the cluster you need and check the version in the config.version property:

    yc managed-kafka cluster get <cluster_name_or_ID>
    
  3. Run the Apache Kafka® upgrade:

    yc managed-kafka cluster update <cluster_name_or_ID> \
       --version=<new_version_number>
    
  1. Open the current Terraform configuration file that defines your infrastructure.

    For more information about creating this file, see Creating clusters.

  2. In the config section of the required Managed Service for Apache Kafka® cluster, add the version field (the Apache Kafka® version) or edit the existing one:

    resource "yandex_mdb_kafka_cluster" "<cluster_name>" {
      ...
      config {
        version = "<version>"
      }
    }
    
  3. Make sure the settings are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. 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.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. 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
  }
}
  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. 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.version",
                  "configSpec": {
                    "version": "<version>"
                  }
                }'
    

    Where:

    • updateMask: List of parameters to update as a single string, separated by commas.

      Here only one parameter is specified: configSpec.version.

    • configSpec.version: target Apache Kafka® version, 3.5.

    You can request the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure the request was successful.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. 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.

  3. 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 of paths[] 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.version"
                ]
              },
              "config_spec": {
                "version": "<version>"
              }
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.kafka.v1.ClusterService.Update
    

    Where:

    • update_mask: List of parameters to update as an array of paths[] strings.

      Here only one parameter is specified: config_spec.version.

    • config_spec.version: target Apache Kafka® version, 3.5.

    You can request the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure the request was successful.

ExamplesExamples

Let's assume you need to upgrade your cluster from version 2.8 to version 3.0.

CLI
  1. To get a list of clusters and find out their IDs and names, run this command:

    yc managed-kafka cluster list
    
    +----------------------+---------------+---------------------+--------+---------+
    |          ID          |     NAME      |     CREATED AT      | HEALTH | STATUS  |
    +----------------------+---------------+---------------------+--------+---------+
    | c9q8p8j2gaih******** |    kafka35    | 2021-10-23 12:44:17 | ALIVE  | RUNNING |
    +----------------------+---------------+---------------------+--------+---------+
    
  2. To get information about a cluster named kafka35, run the following command:

    yc managed-kafka cluster get kafka35
    
      id: c9q8p8j2gaih********
      ...
      config:
        version: "2.8"
        ...
    
  3. To upgrade the kafka35 cluster to version 3.0, run this command:

    yc managed-kafka cluster update kafka35 --version=3.0
    

Was the article helpful?

Previous
Updating cluster settings
Next
Managing disk space
© 2025 Direct Cursus Technology L.L.C.