efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 1 | {{/* |
| 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 | */}} |
| 16 | apiVersion: kafka.strimzi.io/v1beta2 |
| 17 | kind: Kafka |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 18 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 19 | spec: |
| 20 | kafka: |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 21 | version: {{ .Values.config.kafkaVersion }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 22 | replicas: {{ .Values.replicaCount }} |
| 23 | listeners: |
| 24 | - name: plain |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 25 | port: {{ .Values.config.kafkaInternalPort }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 26 | type: internal |
| 27 | tls: false |
| 28 | authentication: |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 29 | type: {{ .Values.config.saslMechanism }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 30 | - name: tls |
| 31 | port: 9093 |
| 32 | type: internal |
| 33 | tls: true |
| 34 | authentication: |
| 35 | type: tls |
| 36 | - name: external |
| 37 | port: 9094 |
Andreas Geissler | eb68c40 | 2023-02-23 11:09:01 +0100 | [diff] [blame] | 38 | type: {{ if (include "common.ingressEnabled" .) }}cluster-ip{{ else }}nodeport{{ end }} |
Andreas Geissler | 2900765 | 2023-03-23 14:05:45 +0100 | [diff] [blame] | 39 | tls: {{ if (include "common.ingressEnabled" .) }}false{{ else }}true{{ end }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 40 | authentication: |
Andreas Geissler | 2900765 | 2023-03-23 14:05:45 +0100 | [diff] [blame] | 41 | type: {{ if (include "common.ingressEnabled" .) }}{{ .Values.config.saslMechanism }}{{ else }}tls{{ end }} |
efiacor | af68a7e | 2022-04-08 10:59:52 +0100 | [diff] [blame] | 42 | configuration: |
Andreas Geissler | eb68c40 | 2023-02-23 11:09:01 +0100 | [diff] [blame] | 43 | {{- if not (include "common.ingressEnabled" .) }} |
efiacor | af68a7e | 2022-04-08 10:59:52 +0100 | [diff] [blame] | 44 | bootstrap: |
Andreas Geissler | 8cd7e26 | 2022-09-13 13:24:50 +0200 | [diff] [blame] | 45 | nodePort: {{ .Values.global.nodePortPrefixExt }}93 |
Andreas Geissler | eb68c40 | 2023-02-23 11:09:01 +0100 | [diff] [blame] | 46 | {{- end }} |
efiacor | af68a7e | 2022-04-08 10:59:52 +0100 | [diff] [blame] | 47 | brokers: |
| 48 | - broker: 0 |
Andreas Geissler | eb68c40 | 2023-02-23 11:09:01 +0100 | [diff] [blame] | 49 | advertisedHost: {{ .Values.config.advertisedHost }} |
| 50 | advertisedPort: {{ .Values.config.advertizedPortBroker0 }} |
| 51 | {{- if not (include "common.ingressEnabled" .) }} |
Andreas Geissler | 8cd7e26 | 2022-09-13 13:24:50 +0200 | [diff] [blame] | 52 | nodePort: {{ .Values.global.nodePortPrefixExt }}90 |
Andreas Geissler | eb68c40 | 2023-02-23 11:09:01 +0100 | [diff] [blame] | 53 | {{- end }} |
efiacor | af68a7e | 2022-04-08 10:59:52 +0100 | [diff] [blame] | 54 | - broker: 1 |
Andreas Geissler | eb68c40 | 2023-02-23 11:09:01 +0100 | [diff] [blame] | 55 | advertisedHost: {{ .Values.config.advertisedHost }} |
| 56 | advertisedPort: {{ .Values.config.advertizedPortBroker1 }} |
| 57 | {{- if not (include "common.ingressEnabled" .) }} |
Andreas Geissler | 8cd7e26 | 2022-09-13 13:24:50 +0200 | [diff] [blame] | 58 | nodePort: {{ .Values.global.nodePortPrefixExt }}91 |
Andreas Geissler | eb68c40 | 2023-02-23 11:09:01 +0100 | [diff] [blame] | 59 | {{- end }} |
Andreas Geissler | 8cd7e26 | 2022-09-13 13:24:50 +0200 | [diff] [blame] | 60 | - broker: 2 |
Andreas Geissler | eb68c40 | 2023-02-23 11:09:01 +0100 | [diff] [blame] | 61 | advertisedHost: {{ .Values.config.advertisedHost }} |
| 62 | advertisedPort: {{ .Values.config.advertizedPortBroker2 }} |
| 63 | {{- if not (include "common.ingressEnabled" .) }} |
Andreas Geissler | 8cd7e26 | 2022-09-13 13:24:50 +0200 | [diff] [blame] | 64 | nodePort: {{ .Values.global.nodePortPrefixExt }}92 |
Andreas Geissler | eb68c40 | 2023-02-23 11:09:01 +0100 | [diff] [blame] | 65 | {{- end }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 66 | authorization: |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 67 | type: {{ .Values.config.authType }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 68 | superUsers: |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 69 | - {{ .Values.config.strimziKafkaAdminUser }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 70 | template: |
| 71 | pod: |
| 72 | securityContext: |
| 73 | runAsUser: 0 |
| 74 | fsGroup: 0 |
Andreas Geissler | 64f95b1 | 2023-11-17 11:35:18 +0100 | [diff] [blame] | 75 | {{- if .Values.affinity.podAntiAffinity.enabled }} |
| 76 | affinity: |
| 77 | podAntiAffinity: |
| 78 | requiredDuringSchedulingIgnoredDuringExecution: |
| 79 | - labelSelector: |
| 80 | matchExpressions: |
| 81 | - key: strimzi.io/name |
| 82 | operator: In |
| 83 | values: |
| 84 | - {{ include "common.fullname" . }}-kafka |
| 85 | topologyKey: "kubernetes.io/hostname" |
| 86 | {{- end }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 87 | config: |
efiacor | 23361a3 | 2022-03-14 13:44:02 +0000 | [diff] [blame] | 88 | default.replication.factor: {{ .Values.replicaCount }} |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 89 | min.insync.replicas: {{ (eq 1.0 (.Values.replicaCount)) | ternary 1 (sub .Values.replicaCount 1) }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 90 | offsets.topic.replication.factor: {{ .Values.replicaCount }} |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 91 | num.partitions: {{ mul .Values.replicaCount 2 }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 92 | transaction.state.log.replication.factor: {{ .Values.replicaCount }} |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 93 | transaction.state.log.min.isr: {{ (eq 1.0 (.Values.replicaCount)) | ternary 1 (sub .Values.replicaCount 1) }} |
| 94 | log.message.format.version: {{ .Values.config.kafkaVersion }} |
| 95 | inter.broker.protocol.version: {{ .Values.config.kafkaVersion }} |
Lukasz Rajewski | 3d097d9 | 2023-10-02 13:10:15 +0200 | [diff] [blame] | 96 | auto.create.topics.enable: {{ .Values.config.autoCreateTopics }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 97 | storage: |
| 98 | type: jbod |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 99 | volumes: |
| 100 | - id: 0 |
| 101 | type: persistent-claim |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 102 | size: {{ .Values.persistence.kafka.size }} |
efiacor | b7a43e2 | 2022-04-01 17:41:48 +0100 | [diff] [blame] | 103 | deleteClaim: true |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 104 | class: {{ include "common.storageClass" (dict "dot" . "suffix" "kafka" "persistenceInfos" .Values.persistence.kafka) }} |
miroslavmasaryk | aa5f0fa | 2023-03-20 10:21:36 +0100 | [diff] [blame] | 105 | {{- if .Values.metrics.kafkaExporter.enabled }} |
| 106 | metricsConfig: |
| 107 | type: {{ .Values.metrics.kafkaExporter.metricsConfig.type }} |
| 108 | valueFrom: |
| 109 | configMapKeyRef: |
| 110 | name: {{ include "common.fullname" . }} |
| 111 | key: kafka-metrics-config.yml |
| 112 | {{- end }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 113 | zookeeper: |
| 114 | template: |
| 115 | pod: |
| 116 | securityContext: |
| 117 | runAsUser: 0 |
| 118 | fsGroup: 0 |
Andreas Geissler | 64f95b1 | 2023-11-17 11:35:18 +0100 | [diff] [blame] | 119 | {{- if .Values.affinity.podAntiAffinity.enabled }} |
| 120 | affinity: |
| 121 | podAntiAffinity: |
| 122 | requiredDuringSchedulingIgnoredDuringExecution: |
| 123 | - labelSelector: |
| 124 | matchExpressions: |
| 125 | - key: strimzi.io/name |
| 126 | operator: In |
| 127 | values: |
| 128 | - {{ include "common.fullname" . }}-zookeeper |
| 129 | topologyKey: "kubernetes.io/hostname" |
| 130 | {{- end }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 131 | replicas: {{ .Values.replicaCount }} |
| 132 | config: |
| 133 | ssl.hostnameVerification: false |
efiacor | 1cfa2fb | 2022-06-01 16:02:39 +0100 | [diff] [blame] | 134 | ssl.quorum.hostnameVerification: false |
Andreas Geissler | 485f667 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 135 | {{- if (include "common.onServiceMesh" .) }} |
| 136 | sslQuorum: false |
| 137 | {{- end }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 138 | storage: |
| 139 | type: persistent-claim |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 140 | size: {{ .Values.persistence.zookeeper.size }} |
efiacor | b7a43e2 | 2022-04-01 17:41:48 +0100 | [diff] [blame] | 141 | deleteClaim: true |
efiacor | 57901a9 | 2022-11-14 16:17:15 +0000 | [diff] [blame] | 142 | class: {{ include "common.storageClass" (dict "dot" . "suffix" "zk" "persistenceInfos" .Values.persistence.zookeeper) }} |
miroslavmasaryk | aa5f0fa | 2023-03-20 10:21:36 +0100 | [diff] [blame] | 143 | {{- if .Values.metrics.kafkaExporter.enabled }} |
| 144 | metricsConfig: |
| 145 | type: {{ .Values.metrics.kafkaExporter.metricsConfig.type }} |
| 146 | valueFrom: |
| 147 | configMapKeyRef: |
| 148 | name: {{ include "common.fullname" . }} |
| 149 | key: zookeeper-metrics-config.yml |
| 150 | {{- end }} |
efiacor | 5c57331 | 2022-01-27 13:46:56 +0000 | [diff] [blame] | 151 | entityOperator: |
| 152 | topicOperator: {} |
| 153 | userOperator: {} |
miroslavmasaryk | aa5f0fa | 2023-03-20 10:21:36 +0100 | [diff] [blame] | 154 | {{- if .Values.cruiseControl.enabled }} |
| 155 | cruiseControl: |
| 156 | metricsConfig: |
| 157 | type: {{ .Values.cruiseControl.metricsConfig.type }} |
| 158 | valueFrom: |
| 159 | configMapKeyRef: |
| 160 | name: {{ include "common.fullname" . }} |
| 161 | key: cruisecontrol-metrics-config.yml |
| 162 | {{- end }} |
| 163 | {{- if .Values.metrics.kafkaExporter.enabled }} |
| 164 | kafkaExporter: |
| 165 | topicRegex: {{ .Values.metrics.kafkaExporter.topicRegex }} |
| 166 | groupRegex: {{ .Values.metrics.kafkaExporter.groupRegex }} |
| 167 | resources: |
| 168 | requests: |
| 169 | cpu: {{ .Values.metrics.kafkaExporter.resources.requests.cpu }} |
| 170 | memory: {{ .Values.metrics.kafkaExporter.resources.requests.memory }} |
| 171 | limits: |
| 172 | cpu: {{ .Values.metrics.kafkaExporter.resources.limits.cpu }} |
| 173 | memory: {{ .Values.metrics.kafkaExporter.resources.limits.memory }} |
| 174 | logging: {{ .Values.metrics.kafkaExporter.logging }} |
| 175 | enableSaramaLogging: {{ .Values.metrics.kafkaExporter.enableSaramaLogging }} |
| 176 | readinessProbe: |
| 177 | initialDelaySeconds: {{ .Values.metrics.kafkaExporter.readinessProbe.initialDelaySeconds }} |
| 178 | timeoutSeconds: {{ .Values.metrics.kafkaExporter.readinessProbe.timeoutSeconds }} |
| 179 | livenessProbe: |
| 180 | initialDelaySeconds: {{ .Values.metrics.kafkaExporter.livenessProbe.initialDelaySeconds }} |
| 181 | timeoutSeconds: {{ .Values.metrics.kafkaExporter.livenessProbe.timeoutSeconds }} |
| 182 | {{- end }} |