1 # Copyright © 2017 Amdocs, Bell Canada
2 # Modifications Copyright © 2018 AT&T
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 apiVersion: apps/v1beta1
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24 release: {{ .Release.Name }}
25 heritage: {{ .Release.Service }}
27 serviceName: {{ .Values.service.name }}
28 replicas: {{ .Values.replicaCount }}
29 podManagementPolicy: Parallel
33 app: {{ include "common.name" . }}
34 release: {{ .Release.Name }}
37 {{if eq .Values.podAntiAffinityType "hard" -}}
38 requiredDuringSchedulingIgnoredDuringExecution:
40 preferredDuringSchedulingIgnoredDuringExecution:
49 - {{ include "common.name" . }}
50 topologyKey: "kubernetes.io/hostname"
51 {{- if .Values.nodeAffinity }}
53 {{ toYaml .Values.nodeAffinity | indent 10 }}
56 - name: {{ include "common.name" . }}-initcontainer
57 image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}"
58 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
63 - {{ .Values.zookeeper.name }}
69 fieldPath: metadata.namespace
70 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
71 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72 name: {{ include "common.name" . }}-readiness
77 chown -R 1000:1000 /opt/kafka/data;
78 image: "{{ .Values.busyBoxRepository }}/{{ .Values.busyBoxImage }}"
79 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81 - mountPath: /opt/kafka/data
83 name: {{ include "common.name" . }}-permission-fixer
85 - name: {{ include "common.name" . }}
86 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
87 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
92 export KAFKA_BROKER_ID=${HOSTNAME##*-} && \
93 export ENDPOINT_PORT=$(( $KAFKA_BROKER_ID + {{ .Values.service.baseNodePort }} )) && \
94 export KAFKA_ADVERTISED_LISTENERS=EXTERNAL_SASL_PLAINTEXT://$(HOST_IP):$(( $KAFKA_BROKER_ID + {{ .Values.service.baseNodePort }} )),INTERNAL_SASL_PLAINTEXT://:{{ .Values.service.internalPort }} && \
97 {{ include "common.resources" . | indent 12 }}
99 - containerPort: {{ .Values.service.internalPort }}
100 - containerPort: {{ .Values.service.externalPort }}
101 {{ if eq .Values.liveness.enabled true }}
104 port: {{ .Values.service.internalPort }}
105 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
106 periodSeconds: {{ .Values.liveness.periodSeconds }}
110 port: {{ .Values.service.internalPort }}
111 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
112 periodSeconds: {{ .Values.readiness.periodSeconds }}
118 fieldPath: status.hostIP
119 - name: KAFKA_ZOOKEEPER_CONNECT
120 value: "{{.Values.zookeeper.name}}:{{.Values.zookeeper.port}}"
121 - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
122 value: "INTERNAL_SASL_PLAINTEXT:SASL_PLAINTEXT,EXTERNAL_SASL_PLAINTEXT:SASL_PLAINTEXT"
123 - name: KAFKA_LISTENERS
124 value: "EXTERNAL_SASL_PLAINTEXT://0.0.0.0:{{ .Values.service.externalPort }},INTERNAL_SASL_PLAINTEXT://0.0.0.0:{{ .Values.service.internalPort }}"
125 - name: KAFKA_INTER_BROKER_LISTENER_NAME
126 value: "INTERNAL_SASL_PLAINTEXT"
127 - name: KAFKA_SASL_ENABLED_MECHANISMS
129 - name: KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL
131 - name: KAFKA_AUTHORIZER_CLASS_NAME
132 value: "{{ .Values.kafkaCustomAuthorizer }}"
133 - name: KAFKA_DELETE_TOPIC_ENABLE
134 value: "{{ .Values.deleteTopicEnable }}"
135 - name: aaf_locate_url
136 value: "https://aaf-locate:8095"
137 - name: KAFKA_LOG_DIRS
138 value: "/opt/kafka/data"
139 - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
140 value: "{{ .Values.replicaCount }}"
141 - name: KAFKA_DEFAULT_REPLICATION_FACTOR
142 value: "{{ .Values.replicaCount }}"
143 - name: KAFKA_NUM_PARTITIONS
144 value: "{{ .Values.defaultpartitions }}"
146 - mountPath: /etc/localtime
149 - mountPath: /var/run/docker.sock
151 - mountPath: /opt/kafka/data
153 {{- if .Values.tolerations }}
155 {{ toYaml .Values.tolerations | indent 10 }}
161 - name: docker-socket
163 path: /var/run/docker.sock
164 {{ if not .Values.persistence.enabled }}
168 volumeClaimTemplates:
172 app: {{ include "common.fullname" . }}
173 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
174 release: "{{ .Release.Name }}"
175 heritage: "{{ .Release.Service }}"
178 - {{ .Values.persistence.accessMode | quote }}
181 storage: {{ .Values.persistence.size | quote }}
184 release: "{{ .Release.Name }}"
185 app: {{ .Values.service.name }}
186 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
187 heritage: "{{ .Release.Service }}"
190 - name: "{{ include "common.namespace" . }}-docker-registry-key"