Skip to content

Commit 8eea26e

Browse files
authored
feat: migrate Kafka to KRaft (#162)
* feat: kraft migration
1 parent a14b019 commit 8eea26e

File tree

8 files changed

+83
-6
lines changed

8 files changed

+83
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
bin/
22
*.tmp.yaml
3-
dockerconfig.json
3+
dockerconfig.json
4+
.DS_Store

nebuly-platform/CHANGELOG.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
# Changelog
22

3-
## v1.78.1
3+
## v1.79.0
44

55
### Features
6-
* Strimzi Kafka Operator now uses NodePools CR to manage brokers
6+
* Kafka now uses KRaft as consesus algorithm and deprecates Zookeeper
77

8-
## v1.78.0
8+
### Breaking changes
9+
* If using Kafka through Strimzi operator:
10+
- The upgrade to this version **MUST** be done from v1.78.0
11+
- First set in the values.yaml **kafka.kraft=disabled**, then **kafka.kraft=migration**
12+
- and finally, after it is finished, remove it so it will default to **enabled**
13+
14+
## v1.78.1
915

1016
### Fixes
1117
* Fix to broken SQL query in the backend
1218

19+
## v1.78.0
20+
21+
### Features
22+
* Strimzi Kafka Operator now uses NodePools CR to manage brokers
23+
1324
## v1.17.0
1425

1526
### Features

nebuly-platform/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type: application
77
# This is the chart version. This version number should be incremented each time you make changes
88
# to the chart and its templates, including the app version.
99
# Versions are expected to follow Semantic Versioning (https://semver.org/)
10-
version: 1.78.1
10+
version: 1.79.0
1111

1212
# This is the version number of the application being deployed. This version number should be
1313
# incremented each time you make changes to the application. Versions are not expected to

nebuly-platform/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Nebuly Platform
22

3-
![Version: 1.78.1](https://img.shields.io/badge/Version-1.78.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)
3+
![Version: 1.79.0](https://img.shields.io/badge/Version-1.79.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)
44

55
Helm chart for installing Nebuly's Platform on Kubernetes.
66

@@ -509,11 +509,20 @@ The command removes all the Kubernetes components associated with the chart and
509509
| kafka.affinity | object | `{}` | |
510510
| kafka.bootstrapServers | string | `""` | [external] Comma separated list of Kafka brokers. |
511511
| kafka.config."replica.selector.class" | string | `"org.apache.kafka.common.replica.RackAwareReplicaSelector"` | |
512+
| kafka.controller.affinity | object | `{}` | |
513+
| kafka.controller.replicas | int | `3` | |
514+
| kafka.controller.resources.limits.memory | string | `"2048Mi"` | |
515+
| kafka.controller.resources.requests.cpu | string | `"100m"` | |
516+
| kafka.controller.resources.requests.memory | string | `"1024Mi"` | |
517+
| kafka.controller.storage.deleteClaim | bool | `false` | |
518+
| kafka.controller.storage.size | string | `"10Gi"` | |
519+
| kafka.controller.storage.type | string | `"persistent-claim"` | |
512520
| kafka.createTopics | bool | `true` | [external] If True, create the Kafka topics automatically if not present on the specified external Kafka cluster. |
513521
| kafka.existingSecret | object | - | [external] Use an existing secret for Kafka authentication. |
514522
| kafka.existingSecret.name | string | `""` | Name of the secret. Can be templated. |
515523
| kafka.existingSecret.sslCaCertKey | string | `""` | The key of the secret containing the CA certificate (in PEM format) used for SSL authentication. |
516524
| kafka.external | bool | `false` | If false, deploy a Kafka cluster together with the platform services. Otherwise, use an existing Kafka cluster. |
525+
| kafka.kraft | string | `"enabled"` | It can be: enabled, disabled, migration, rollback. See https://strimzi.io/docs/operators/latest/deploying#proc-deploy-migrate-kraft-str |
517526
| kafka.krb5Config | string | `""` | [external] Used only when saslMechanism is set to "GSSAPI". The Keberos configuration file used for SASL GSSAPI authentication. |
518527
| kafka.nameOverride | string | `""` | with the provided value. |
519528
| kafka.rack.topologyKey | string | `"topology.kubernetes.io/zone"` | |

nebuly-platform/templates/_kafka.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
{{ .Values.kafka.user }}
77
{{- end -}}
88

9+
{{- define "kafka.kraft" -}}
10+
{{ .Values.kafka.kraft | default "enabled" }}
11+
{{- end -}}
12+
913
{{- define "kafka.bootstrapServers" -}}
1014
{{- if .Values.kafka.external -}}
1115
{{ .Values.kafka.bootstrapServers }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{ if not .Values.kafka.external -}}
2+
apiVersion: kafka.strimzi.io/v1beta2
3+
kind: KafkaNodePool
4+
metadata:
5+
name: controller
6+
namespace: {{ include "nebuly-platform.namespace" . }}
7+
labels:
8+
strimzi.io/cluster: {{ include "kafka.fullname" . }}
9+
{{- include "nebuly-platform.selectorLabels" . | nindent 4 }}
10+
annotations:
11+
{{- include "nebuly-platform.annotations" . | nindent 4 }}
12+
spec:
13+
replicas: {{ .Values.kafka.controller.replicas }}
14+
roles:
15+
- controller
16+
storage:
17+
type: persistent-claim
18+
size: {{ .Values.kafka.controller.storage.size }}
19+
{{- with .Values.kafka.controller.storage.deleteClaim }}
20+
deleteClaim: {{ . }}
21+
{{- end }}
22+
{{- with .Values.kafka.controller.storage.class }}
23+
class: {{ . }}
24+
{{- end }}
25+
resources:
26+
{{- toYaml .Values.kafka.controller.resources | nindent 4 }}
27+
template:
28+
pod:
29+
affinity: {{- toYaml .Values.kafka.controller.affinity | nindent 8 }}
30+
{{- end }}

nebuly-platform/templates/kafka-cluster_main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
namespace: {{ include "nebuly-platform.namespace" . }}
77
annotations:
88
strimzi.io/node-pools: enabled
9+
strimzi.io/kraft: {{ include "kafka.kraft" . }}
910
{{- include "nebuly-platform.annotations" . | nindent 4 }}
1011
spec:
1112
zookeeper:

nebuly-platform/values.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,10 @@ kafka:
833833
# -- The number of Kafka brokers in the cluster.
834834
replicas: 3
835835

836+
# -- KRaft mode, if true, deploy Kafka in KRaft mode (without Zookeeper).
837+
# -- It can be: enabled, disabled, migration, rollback. See https://strimzi.io/docs/operators/latest/deploying#proc-deploy-migrate-kraft-str
838+
kraft: enabled
839+
836840
affinity: { }
837841

838842
# -- The storage class used for the Kafka and Zookeeper storage.
@@ -856,6 +860,23 @@ kafka:
856860
requests:
857861
cpu: 100m
858862
memory: 1024Mi
863+
# Settings of the Controller NodePool.
864+
# @default -- -
865+
controller:
866+
replicas: 3
867+
affinity: { }
868+
storage:
869+
type: persistent-claim
870+
size: 10Gi
871+
deleteClaim: false
872+
# Resources of the Controller pods.
873+
# @default -- -
874+
resources:
875+
limits:
876+
memory: 2048Mi
877+
requests:
878+
cpu: 100m
879+
memory: 1024Mi
859880
# Settings of the Zookeeper cluster.
860881
# @default -- -
861882
zookeeper:

0 commit comments

Comments
 (0)