Open gAmUssA opened 6 years ago
have you tried using kubernetes downward api for specifying the ZOOKEEPER_SERVER_ID?
something like this would generate the unique ZOOKEEPER_SERVER_ID based on the pod name
env:
- name: ZOOKEEPER_SERVER_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
I managed to make it work by specifying the docker container command at the kubernetes .yaml file as follows
command:
- /bin/bash
- -c
- export ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-}+1)) && /etc/confluent/docker/run
Currently
ZOOKEEPER_SERVER_ID
needs to be set otherwise container will fail to start. BecauseZOOKEEPER_SERVER_ID
used as a template to fulfill zookeeper'smyid
file. In Kubernetes environment,myid
should be generated based on id of StatefulSet pod instance.