Home > OS >  New kafka pod replicas cannot find CA on scaling
New kafka pod replicas cannot find CA on scaling

Time:03-17

I have a kubernetes cluster with a kafka zookeeper statefulset that works fine with one pod. However, when for performance reasons I try to scale the statefulset to three pods with the following command:

kubectl scale statefulset <my_zookeper_statefulset> --replicas=3

The two new pods go into an Error and then a CrashLoopBackOff with the following logs:

Detected Zookeeper ID 3
Preparing truststore
Adding /opt/kafka/cluster-ca-certs/ca.crt to truststore /tmp/zookeeper/cluster.truststore.p12 with alias ca
Certificate was added to keystore
Preparing truststore is complete
Looking for the right CA
No CA found. Thus exiting.

The certificate in question exists and is used by the existing pod without problem. The same error occurs when I try to scale my kafka brokers.

Tl;dr: How do I scale kafka up without error?

CodePudding user response:

When do you use Kafka you can't go to this way. To do this, you need to configure replicas parameter in your file. Example of spec properties for the Kafka resource:

apiVersion: YourVersion
kind: Kafka 
metadata: 
  name: my-cluster
spec: 
  kafka: 
    replicas: 3 

Secondly also you can create ReplicationController Service for comfortable work with replicas.

  • Related