Kafka pods not running in different nodes with pod-antiaffinity specified #4922
shreyasarani23
started this conversation in
General
Replies: 1 comment 11 replies
-
Please check the documentation for where the affinity should be configured. I don't think you have it in the right place. |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Below is my kafka configuration I have used pod antiaffinity to schedule kafka pods on different nodes
apiVersion: kafka.strimzi.io/v1beta1
kind: Kafka
metadata:
name: my-kafka-cluster
labels:
app: kafkaPod
spec:
kafka:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- kafkPod
topologyKey: "kubernetes.io/hostname"
version: 2.7.0
replicas: 3
listeners:
- name: plain
port: 9092
type: internal
tls: false
config:
offsets.topic.replication.factor: 3
transaction.state.log.replication.factor: 3
transaction.state.log.min.isr: 2
log.message.format.version: "2.7"
auto.create.topics.enable: true
auto.leader.rebalance.enable: true
delete.topic.enable: true
storage:
type: persistent-claim
size: 1Gi
class: kafka-storage-class
deleteClaim: true
zookeeper:
replicas: 3
storage:
type: persistent-claim
size: 1Gi
class: kafka-storage-class
deleteClaim: true
entityOperator:
topicOperator: {}
But the problem is that only one kafka pod is getting deployed and the other two are in pending state.
When I describe the pod to check why it is in pending state it says the following
0/3 nodes are available: didn't match pod affinity/anti-affinity.
Is there anything wrong in my deployment file?
Please correct me If I am wrong
Beta Was this translation helpful? Give feedback.
All reactions