<p>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:</p>
<pre><code>kubectl scale statefulset &lt;my_zookeper_statefulset&gt; --replicas=3
</code></pre>
<p>The two new pods go into an Error and then a CrashLoopBackOff with the following logs:</p>
<pre><code>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.
</code></pre>
<p>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.</p>
<p>Tl;dr: How do I scale kafka up without error?</p>

sigma1510
<p>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 <code>spec</code> properties for the <code>Kafka</code> resource:</p>
<pre><code>apiVersion: YourVersion
kind: Kafka 
metadata: 
  name: my-cluster
spec: 
  kafka: 
    replicas: 3 
</code></pre>
<p>Secondly also you can create <a href="https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/" rel="nofollow noreferrer">ReplicationController Service</a> for comfortable work with replicas.</p>
