Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 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
      • Upgrading Apache Kafka® version
      • Managing disk space
      • Stopping and starting a cluster
      • Getting a list of cluster hosts
      • Migrating hosts to a different availability zone
      • Maintenance
      • Deleting a cluster
    • Managing topics
    • Managing users
    • Managing connectors
    • Kafka UI for Apache Kafka®
  • Access management
  • Pricing policy
  • Terraform reference
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ

In this article:

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

Apache Kafka® version upgrade

Written by
Yandex Cloud
Updated at January 22, 2026
  • Before upgrading a version
  • 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 existing clusters to version 3.9.

You can find the list of supported versions in the Apache Kafka® versioning policy section. 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.

Learn more about minor version updates and host maintenance in Maintenance.

Before upgrading a versionBefore upgrading a version

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. In the management console, navigate to the relevant folder.
  2. Go to Managed Service for Kafka.
  3. In the cluster row, click and select Edit.
  4. In the Version field, select the new version number.
  5. Click Save.

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.

  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 describing your infrastructure.

    To learn how to create this file, see Creating a cluster.

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

    export IAM_TOKEN="<IAM_token>"
    
  2. 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 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: Comma-separated string of settings you want to update.

      Here, we only specified a single setting, configSpec.version.

    • configSpec.version: Target Apache Kafka® version, 3.6, 3.7, 3.8 or 3.9.

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

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

  1. Get an IAM token for API authentication and put it into an 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 that the repository contents reside in the ~/cloudapi/ directory.

  3. Call the ClusterService/Update method, e.g., via the following gRPCurl 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 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 settings you want to update as an array of strings (paths[]).

      Here, we only specified a single setting, config_spec.version.

    • config_spec.version: Target Apache Kafka® version, 3.6, 3.7, 3.8 or 3.9.

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

  4. Check the server response to make sure your 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 with 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 the kafka35 cluster, 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
© 2026 Direct Cursus Technology L.L.C.