Skip to content

Commit ebc5042

Browse files
committed
Breaking: renames the statefulset's headless service so
the pod name or statefulset.kubernetes.io/pod-name can be used via the downward api in args to do things like --override listeners=PLAINTEXT://$(POD_NAME).kafka:9092 Once again it's unfortunate that the statefulset label is pod name, not pod index. Also makes sure that DNS entries are published prior to readiness so clusters don't get into loops of not being able to find each other.
1 parent 377a0c3 commit ebc5042

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

kafka/20dns.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
apiVersion: v1
44
kind: Service
55
metadata:
6-
name: broker
6+
name: kafka
77
namespace: kafka
8+
annotations:
9+
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
810
spec:
11+
publishNotReadyAddresses: true
912
ports:
1013
- port: 9092
1114
# [podname].broker.kafka.svc.cluster.local

kafka/50kafka.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spec:
77
selector:
88
matchLabels:
99
app: kafka
10-
serviceName: "broker"
10+
serviceName: "kafka"
1111
replicas: 3
1212
updateStrategy:
1313
type: RollingUpdate

0 commit comments

Comments
 (0)