71 lines
1.5 KiB
YAML
71 lines
1.5 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: kafka-client-config
|
|
namespace: basic
|
|
type: Opaque
|
|
data:
|
|
# base64 decode, then connect address
|
|
kafka.properties: Ym9vdHN0cmFwLnNlcnZlcnM9a2Fma2EuYmFzaWMuc3ZjLmNsdXN0ZXIubG9jYWw6OTA3MQpzZWN1cml0eS5wcm90b2NvbD1QTEFJTlRFWFQ=
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: elastic
|
|
namespace: basic
|
|
spec:
|
|
serviceName: elastic
|
|
podManagementPolicy: Parallel
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: elastic
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: elastic
|
|
spec:
|
|
containers:
|
|
- name: elastic
|
|
image: confluentinc/cp-kafka:latest
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
kafka-producer-perf-test \
|
|
--topic elastic-0 \
|
|
--record-size 64 \
|
|
--throughput 1 \
|
|
--producer.config /mnt/kafka.properties \
|
|
--num-records 230400
|
|
volumeMounts:
|
|
- name: kafka-properties
|
|
mountPath: /mnt
|
|
readOnly: true
|
|
resources:
|
|
requests:
|
|
memory: 512Mi # 768Mi
|
|
cpu: 500m # 1000m
|
|
volumes:
|
|
- name: kafka-properties # Create secret with name `kafka-client-config` with client configurations
|
|
secret:
|
|
secretName: kafka-client-config
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: elastic
|
|
spec:
|
|
clusterIP: None
|
|
---
|
|
apiVersion: platform.confluent.io/v1beta1
|
|
kind: KafkaTopic
|
|
metadata:
|
|
name: elastic-0
|
|
namespace: basic
|
|
spec:
|
|
replicas: 3
|
|
# partitionCount: 3
|
|
configs:
|
|
cleanup.policy: "delete" |