Install Kafka on K8s 1.18.3
Environment
- k8s:
1.18.3
- Chart:
bitnami/kafka:25.3.5
- Image:
kafka:3.5.1-debian-11-r44
Helm Chart
bash
helm search repo bitnami/kafka --versions
bash
helm pull bitnami/kafka --version 25.3.5
Disable Zookeeper
yaml
kraft:
## @param kraft.enabled Switch to enable or disable the KRaft mode for Kafka
##
enabled: true
zookeeper:
## @param zookeeper.enabled Switch to enable or disable the ZooKeeper helm chart. Must be false if you use KRaft mode.
##
enabled: false
## @param zookeeper.replicaCount Number of ZooKeeper nodes
##
replicaCount: 1
## ZooKeeper authentication
##
kraft.enabled
: truezookeeper.enabled
: false
Errors
SecompProfile
prolog
Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(StatefulSet.spec.template.spec.containers[0].securityContext): unknown field "seccompProfile" in io.k8s.api.core.v1.SecurityContext
bash
grep -r seccompProfile *
Delete all seccomProfile
Replication Factor
prolog
[2025-01-13 10:32:27,380] INFO [QuorumController id=0] CreateTopics result(s): CreatableTopic(name='__consumer_offsets', numPartitions=50, replicationFactor=3, assignments=[], configs=[CreateableTopicConfig(name='compression.type', value='producer'), CreateableTopicConfig(name='cleanup.policy', value='compact'), CreateableTopicConfig(name='segment.bytes', value='104857600')]): INVALID_REPLICATION_FACTOR (Unable to replicate the partition 3 time(s): The target replication factor of 3 cannot be reached because only 1 broker(s) are registered.) (org.apache.kafka.controller.ReplicationControlManager)
Modify replication factor.
toml
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1
#default.replication.factor=1
#min.insync.replicas=1
TroubleShooting
If no pod start
bash
kubectl describe statefulset foobar-kafka-controller