Managing Kafka topics

Editing a Kafka topic

By using the CLI

  1. Log in to your Kubernetes cluster as a cluster administrator by setting your kubectl context.
  2. Run the following command to initialize the Event Streams CLI on the cluster:

    kubecl es init
    
  3. Run the following command to edit the configuration of a topic:

    kubectl es topic-update --name <topic-name> --config KEY[=VALUE]
    

    For example:

    • To update a topic called my-topic to have min.insync.replicas as 2:

      kubectl es topic-update --name my-topic --config min.insync.replicas=2
      
    • To update the number of topic partitions to 5 :

      kubectl es topic-partitions-set -n my-topic -p 5
      

    Note: To view all configuration options you can set for topics, use the help option as follows:

       kubectl es topic-update --help
    

Deleting a Kafka topic

To delete a Kafka topic, complete the following steps:

By using the UI

  1. Log in to the Event Streams UI from a supported web browser (see how to determine the login URL for your Event Streams UI).
  2. Click Home in the primary navigation.
  3. Navigate to Topics tab.
  4. Click Topic Delete button in the overflow menu of the topic you want to delete. The topic is deleted and is removed from the list of topics.

By using the CLI

  1. Log in to your Kubernetes cluster as a cluster administrator by setting your kubectl context.
  2. Run the following command to initialize the Event Streams CLI on the cluster:

    kubectl es init
    
  3. Run the following command to delete a topic:

    kubectl es topic-delete --name <topic-name>