-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkafka-sts.yaml
105 lines (105 loc) · 2.79 KB
/
kafka-sts.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: kafka
name: kafka
spec:
podManagementPolicy: OrderedReady
replicas: 3
revisionHistoryLimit: 1
selector:
matchLabels:
app: kafka
serviceName: kafka-headless
template:
metadata:
labels:
app: kafka
spec:
imagePullSecrets:
- name: nexuspullsecret
containers:
- command:
- sh
- "-exc"
- |
unset KAFKA_PORT && \
export KAFKA_BROKER_ID=${HOSTNAME##*-} && \
export KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://${POD_IP}:9092 && \
exec /etc/confluent/docker/run
env:
-
name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
-
name: KAFKA_HEAP_OPTS
value: "-Xmx1G -Xms1G"
-
name: KAFKA_ZOOKEEPER_CONNECT
value: "zk-cs:2181"
-
name: KAFKA_LOG_DIRS
value: /opt/kafka/data/logs
-
name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
value: "3"
-
name: KAFKA_JMX_PORT
value: "5555"
image: "192.168.161.187:9050/confluentinc/cp-kafka:5.3.2"
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
command:
- sh
- "-ec"
- "/usr/bin/jps | /bin/grep -q SupportedKafka"
failureThreshold: 3
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
name: kafka-broker
ports:
-
containerPort: 9092
name: kafka
protocol: TCP
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: kafka
timeoutSeconds: 5
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
-
mountPath: /opt/kafka/data
name: kafka1
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 60
updateStrategy:
type: OnDelete
volumeClaimTemplates:
-
metadata:
annotations:
volume.alpha.kubernetes.io/storage-class: default
name: kafka1
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi