blob: 421d93a6cba969daa21b78168643dd17d32b0446 [file] [log] [blame]
efiacor5c573312022-01-27 13:46:56 +00001{{/*
2# Copyright © 2022 Nordix Foundation
3#
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
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
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.
15*/}}
16apiVersion: kafka.strimzi.io/v1beta2
17kind: Kafka
efiacor57901a92022-11-14 16:17:15 +000018metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
efiacor5c573312022-01-27 13:46:56 +000019spec:
20 kafka:
efiacor57901a92022-11-14 16:17:15 +000021 version: {{ .Values.config.kafkaVersion }}
efiacor5c573312022-01-27 13:46:56 +000022 replicas: {{ .Values.replicaCount }}
23 listeners:
24 - name: plain
efiacor57901a92022-11-14 16:17:15 +000025 port: {{ .Values.config.kafkaInternalPort }}
efiacor5c573312022-01-27 13:46:56 +000026 type: internal
27 tls: false
28 authentication:
efiacor57901a92022-11-14 16:17:15 +000029 type: {{ .Values.config.saslMechanism }}
efiacor5c573312022-01-27 13:46:56 +000030 - name: tls
31 port: 9093
32 type: internal
33 tls: true
34 authentication:
35 type: tls
36 - name: external
37 port: 9094
Andreas Geisslereb68c402023-02-23 11:09:01 +010038 type: {{ if (include "common.ingressEnabled" .) }}cluster-ip{{ else }}nodeport{{ end }}
Andreas Geissler29007652023-03-23 14:05:45 +010039 tls: {{ if (include "common.ingressEnabled" .) }}false{{ else }}true{{ end }}
efiacor5c573312022-01-27 13:46:56 +000040 authentication:
Andreas Geissler29007652023-03-23 14:05:45 +010041 type: {{ if (include "common.ingressEnabled" .) }}{{ .Values.config.saslMechanism }}{{ else }}tls{{ end }}
efiacoraf68a7e2022-04-08 10:59:52 +010042 configuration:
Andreas Geisslereb68c402023-02-23 11:09:01 +010043 {{- if not (include "common.ingressEnabled" .) }}
efiacoraf68a7e2022-04-08 10:59:52 +010044 bootstrap:
Andreas Geissler8cd7e262022-09-13 13:24:50 +020045 nodePort: {{ .Values.global.nodePortPrefixExt }}93
Andreas Geisslereb68c402023-02-23 11:09:01 +010046 {{- end }}
efiacoraf68a7e2022-04-08 10:59:52 +010047 brokers:
48 - broker: 0
Andreas Geisslereb68c402023-02-23 11:09:01 +010049 advertisedHost: {{ .Values.config.advertisedHost }}
50 advertisedPort: {{ .Values.config.advertizedPortBroker0 }}
51 {{- if not (include "common.ingressEnabled" .) }}
Andreas Geissler8cd7e262022-09-13 13:24:50 +020052 nodePort: {{ .Values.global.nodePortPrefixExt }}90
Andreas Geisslereb68c402023-02-23 11:09:01 +010053 {{- end }}
efiacoraf68a7e2022-04-08 10:59:52 +010054 - broker: 1
Andreas Geisslereb68c402023-02-23 11:09:01 +010055 advertisedHost: {{ .Values.config.advertisedHost }}
56 advertisedPort: {{ .Values.config.advertizedPortBroker1 }}
57 {{- if not (include "common.ingressEnabled" .) }}
Andreas Geissler8cd7e262022-09-13 13:24:50 +020058 nodePort: {{ .Values.global.nodePortPrefixExt }}91
Andreas Geisslereb68c402023-02-23 11:09:01 +010059 {{- end }}
Andreas Geissler8cd7e262022-09-13 13:24:50 +020060 - broker: 2
Andreas Geisslereb68c402023-02-23 11:09:01 +010061 advertisedHost: {{ .Values.config.advertisedHost }}
62 advertisedPort: {{ .Values.config.advertizedPortBroker2 }}
63 {{- if not (include "common.ingressEnabled" .) }}
Andreas Geissler8cd7e262022-09-13 13:24:50 +020064 nodePort: {{ .Values.global.nodePortPrefixExt }}92
Andreas Geisslereb68c402023-02-23 11:09:01 +010065 {{- end }}
efiacor5c573312022-01-27 13:46:56 +000066 authorization:
efiacor57901a92022-11-14 16:17:15 +000067 type: {{ .Values.config.authType }}
efiacor5c573312022-01-27 13:46:56 +000068 superUsers:
efiacor57901a92022-11-14 16:17:15 +000069 - {{ .Values.config.strimziKafkaAdminUser }}
efiacor5c573312022-01-27 13:46:56 +000070 template:
71 pod:
72 securityContext:
73 runAsUser: 0
74 fsGroup: 0
75 config:
efiacor23361a32022-03-14 13:44:02 +000076 default.replication.factor: {{ .Values.replicaCount }}
efiacor57901a92022-11-14 16:17:15 +000077 min.insync.replicas: {{ (eq 1.0 (.Values.replicaCount)) | ternary 1 (sub .Values.replicaCount 1) }}
efiacor5c573312022-01-27 13:46:56 +000078 offsets.topic.replication.factor: {{ .Values.replicaCount }}
efiacor57901a92022-11-14 16:17:15 +000079 num.partitions: {{ mul .Values.replicaCount 2 }}
efiacor5c573312022-01-27 13:46:56 +000080 transaction.state.log.replication.factor: {{ .Values.replicaCount }}
efiacor57901a92022-11-14 16:17:15 +000081 transaction.state.log.min.isr: {{ (eq 1.0 (.Values.replicaCount)) | ternary 1 (sub .Values.replicaCount 1) }}
82 log.message.format.version: {{ .Values.config.kafkaVersion }}
83 inter.broker.protocol.version: {{ .Values.config.kafkaVersion }}
efiacor5c573312022-01-27 13:46:56 +000084 storage:
85 type: jbod
efiacor5c573312022-01-27 13:46:56 +000086 volumes:
87 - id: 0
88 type: persistent-claim
efiacor57901a92022-11-14 16:17:15 +000089 size: {{ .Values.persistence.kafka.size }}
efiacorb7a43e22022-04-01 17:41:48 +010090 deleteClaim: true
efiacor57901a92022-11-14 16:17:15 +000091 class: {{ include "common.storageClass" (dict "dot" . "suffix" "kafka" "persistenceInfos" .Values.persistence.kafka) }}
miroslavmasarykaa5f0fa2023-03-20 10:21:36 +010092 {{- if .Values.metrics.kafkaExporter.enabled }}
93 metricsConfig:
94 type: {{ .Values.metrics.kafkaExporter.metricsConfig.type }}
95 valueFrom:
96 configMapKeyRef:
97 name: {{ include "common.fullname" . }}
98 key: kafka-metrics-config.yml
99 {{- end }}
efiacor5c573312022-01-27 13:46:56 +0000100 zookeeper:
101 template:
102 pod:
103 securityContext:
104 runAsUser: 0
105 fsGroup: 0
106 replicas: {{ .Values.replicaCount }}
107 config:
108 ssl.hostnameVerification: false
efiacor1cfa2fb2022-06-01 16:02:39 +0100109 ssl.quorum.hostnameVerification: false
Andreas Geissler485f6672022-04-06 13:12:48 +0200110 {{- if (include "common.onServiceMesh" .) }}
111 sslQuorum: false
112 {{- end }}
efiacor5c573312022-01-27 13:46:56 +0000113 storage:
114 type: persistent-claim
efiacor57901a92022-11-14 16:17:15 +0000115 size: {{ .Values.persistence.zookeeper.size }}
efiacorb7a43e22022-04-01 17:41:48 +0100116 deleteClaim: true
efiacor57901a92022-11-14 16:17:15 +0000117 class: {{ include "common.storageClass" (dict "dot" . "suffix" "zk" "persistenceInfos" .Values.persistence.zookeeper) }}
miroslavmasarykaa5f0fa2023-03-20 10:21:36 +0100118 {{- if .Values.metrics.kafkaExporter.enabled }}
119 metricsConfig:
120 type: {{ .Values.metrics.kafkaExporter.metricsConfig.type }}
121 valueFrom:
122 configMapKeyRef:
123 name: {{ include "common.fullname" . }}
124 key: zookeeper-metrics-config.yml
125 {{- end }}
efiacor5c573312022-01-27 13:46:56 +0000126 entityOperator:
127 topicOperator: {}
128 userOperator: {}
miroslavmasarykaa5f0fa2023-03-20 10:21:36 +0100129 {{- if .Values.cruiseControl.enabled }}
130 cruiseControl:
131 metricsConfig:
132 type: {{ .Values.cruiseControl.metricsConfig.type }}
133 valueFrom:
134 configMapKeyRef:
135 name: {{ include "common.fullname" . }}
136 key: cruisecontrol-metrics-config.yml
137 {{- end }}
138 {{- if .Values.metrics.kafkaExporter.enabled }}
139 kafkaExporter:
140 topicRegex: {{ .Values.metrics.kafkaExporter.topicRegex }}
141 groupRegex: {{ .Values.metrics.kafkaExporter.groupRegex }}
142 resources:
143 requests:
144 cpu: {{ .Values.metrics.kafkaExporter.resources.requests.cpu }}
145 memory: {{ .Values.metrics.kafkaExporter.resources.requests.memory }}
146 limits:
147 cpu: {{ .Values.metrics.kafkaExporter.resources.limits.cpu }}
148 memory: {{ .Values.metrics.kafkaExporter.resources.limits.memory }}
149 logging: {{ .Values.metrics.kafkaExporter.logging }}
150 enableSaramaLogging: {{ .Values.metrics.kafkaExporter.enableSaramaLogging }}
151 readinessProbe:
152 initialDelaySeconds: {{ .Values.metrics.kafkaExporter.readinessProbe.initialDelaySeconds }}
153 timeoutSeconds: {{ .Values.metrics.kafkaExporter.readinessProbe.timeoutSeconds }}
154 livenessProbe:
155 initialDelaySeconds: {{ .Values.metrics.kafkaExporter.livenessProbe.initialDelaySeconds }}
156 timeoutSeconds: {{ .Values.metrics.kafkaExporter.livenessProbe.timeoutSeconds }}
157 {{- end }}