Restart Confluent Platform using Confluent for Kubernetes

There are cases when it is necessary to trigger a restart of a Confluent Platform cluster, such as to apply a license change or to apply credentials changes in a Kubernetes Secret.

Restart Kafka

Some changes in Kafka CR properties require Kafka pods to restart. The rolling restart process of Kafka is different from that of other Confluent components because the integrity of the Kafka data must be preserved during the restart.

CFK automatically restarts Kafka clusters when required. It restarts one broker at a time, starting with the highest numbered broker to 0, i.e., broker-n to broker-0, and checks that there are no under replicated partitions on the broker before proceeding to the next broker. The active controller is not in consideration in this process.

To manually roll Kafka:

  1. Add the following annotation in the Kafka CR:

    spec:
      podTemplate:
        annotations:
          kafkacluster-manual-roll: "n"
    

    Set n to a number that is different than the value used in the previous manual roll. If the same number is used, CFK will not roll Kafka.

  2. Apply the change:

    kubectl apply -f <Kafka CR>
    

Restart Confluent Platform components

Caution

Do not use the steps described in this section to restart Kafka clusters. It may result in data loss.

Restart a Confluent Platform component after making the following updates on the component:

  • Changing Telemetry settings
  • Loading credentials
  • Updating the license
  • Updating the external load balancer domain name
  • Updating the component prefix
  • Updating the authentication user list

To restart a Confluent Platform component cluster:

  1. Find the name of the StatefulSet corresponding to the Confluent Platform cluster you want to restart:

    kubectl get statefulset --namespace <namespace>
    
  2. Using the StatefulSet name, <name-of-statefulset>, retrieved from the previous step, roll the cluster:

    kubectl rollout restart statefulset/<name-of-statefulset> --namespace <namespace>