blob: eb844d7df43c80b4af0c3c3ad2e1ee971d691a04 [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- if (eq .Values.deployment "full") }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: kafka
spec:
selector:
matchLabels:
app: kafka
replicas: 1
template:
metadata:
labels:
app: kafka
spec:
initContainers:
- name: init-wait-consul
image: alpine
command: ["sh", "-c", "for i in $(seq 1 300); do nc -zvw1 zookeeper 2181 && exit 0 || sleep 3; done; exit 1"]
volumes:
- name: kafka-pv
persistentVolumeClaim:
claimName: kafka-pvc
containers:
- name: kafka
image: fogsyio/kafka:{{ .Values.external.kafkaVersion }}
imagePullPolicy: {{ .Values.pullPolicy }}
ports:
- containerPort: 9092
volumeMounts:
- mountPath: "/kafka"
name: kafka-pv
env:
# Known issue with kafka running in kubernetes:
# https://github.com/wurstmeister/kafka-docker/issues/122
- name: KAFKA_PORT
value: "9092"
- name: KAFKA_ZOOKEEPER_CONNECT
value: "zookeeper:2181"
- name: KAFKA_LISTENERS
value: "PLAINTEXT://:9092"
- name: KAFKA_ADVERTISED_LISTENERS
value: "PLAINTEXT://kafka:9092"
- name: KAFKA_INTER_BROKER_LISTENER_NAME
value: "PLAINTEXT"
- name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
value: "PLAINTEXT:PLAINTEXT"
- name: KAFKA_MESSAGE_MAX_BYTES
value: "5000012"
- name: KAFKA_FETCH_MESSAGE_MAX_BYTES
value: "5000012"
- name: KAFKA_REPLICA_FETCH_MAX_BYTES
value: "10000000"
{{- end }}