From 04aa29eee9e2b45cef2d24747812c5930d67baa1 Mon Sep 17 00:00:00 2001 From: Philip Jacobs Date: Fri, 27 Sep 2024 16:34:28 -0700 Subject: [PATCH 1/5] (chore): Allow passing kafka and zookeeper resource limits via values file --- charts/local-kafka/Chart.yaml | 2 +- charts/local-kafka/templates/kafka.yaml | 8 ++++++++ charts/local-kafka/values.yaml | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/charts/local-kafka/Chart.yaml b/charts/local-kafka/Chart.yaml index 6734c94..8e2b83e 100644 --- a/charts/local-kafka/Chart.yaml +++ b/charts/local-kafka/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: local-kafka description: Local Development spinup of Strimzi-managed Kafka type: application -version: 0.42.1 +version: 0.42.2 appVersion: latest maintainers: - name: diranged diff --git a/charts/local-kafka/templates/kafka.yaml b/charts/local-kafka/templates/kafka.yaml index 34dfc40..d901ca2 100644 --- a/charts/local-kafka/templates/kafka.yaml +++ b/charts/local-kafka/templates/kafka.yaml @@ -61,12 +61,20 @@ spec: type: persistent-claim size: 500Mi deleteClaim: false + {{ with .Values.kafka.resources }} + resources: + {{ toYaml . | nindent 6 }} + {{ end }} zookeeper: replicas: 1 storage: type: persistent-claim size: 500Mi deleteClaim: false + {{ with .Values.zookeeper.resources }} + resources: + {{ toYaml . | nindent 6 }} + {{ end }} entityOperator: topicOperator: {} userOperator: {} diff --git a/charts/local-kafka/values.yaml b/charts/local-kafka/values.yaml index 5a9e8dc..64923be 100644 --- a/charts/local-kafka/values.yaml +++ b/charts/local-kafka/values.yaml @@ -24,6 +24,25 @@ kafka: # -- (`str`) Optional value for the kafka cluster pod priority class name priorityClassName: + # -- Optional resource requirements for the Kafka cluster + resources: + limits: + cpu: + memory: + requests: + cpu: + memory: + +zookeeper: + # -- Optional resource requirements for the Kafka cluster + resources: + limits: + cpu: + memory: + requests: + cpu: + memory: + # -- Additional configurable listeners for connecting to brokers. listeners: - name: external From 7f08657af5bf0f311e7dba587caa6edc2ff5df3c Mon Sep 17 00:00:00 2001 From: Philip Jacobs Date: Fri, 27 Sep 2024 16:35:31 -0700 Subject: [PATCH 2/5] fix comment --- charts/local-kafka/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/local-kafka/values.yaml b/charts/local-kafka/values.yaml index 64923be..6bf3053 100644 --- a/charts/local-kafka/values.yaml +++ b/charts/local-kafka/values.yaml @@ -34,7 +34,7 @@ kafka: memory: zookeeper: - # -- Optional resource requirements for the Kafka cluster + # -- Optional resource requirements for the Zookeeper cluster resources: limits: cpu: From 59e1056fd877a8402b897ecb4c76840285c164cb Mon Sep 17 00:00:00 2001 From: Philip Jacobs Date: Fri, 27 Sep 2024 16:36:24 -0700 Subject: [PATCH 3/5] helm docs --- charts/local-kafka/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/local-kafka/README.md b/charts/local-kafka/README.md index 07b95ed..9f0c1a3 100644 --- a/charts/local-kafka/README.md +++ b/charts/local-kafka/README.md @@ -2,7 +2,7 @@ Local Development spinup of Strimzi-managed Kafka -![Version: 0.42.1](https://img.shields.io/badge/Version-0.42.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 0.42.2](https://img.shields.io/badge/Version-0.42.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) [strimzi_op]: https://github.com/strimzi/strimzi-kafka-operator @@ -45,6 +45,7 @@ project's development namespace. | kafka.interBrokerProtocolVersion | `str` | `nil` | Optional value for the inter.broker.protocol.version property (eg. `2.8`) | | kafka.logMessageFormatVersion | `str` | `nil` | Optional value for the log.message.format.version property (eg, `2.7`) | | kafka.priorityClassName | `str` | `nil` | Optional value for the kafka cluster pod priority class name | +| kafka.resources | object | `{"limits":{"cpu":null,"memory":null},"requests":{"cpu":null,"memory":null}}` | Optional resource requirements for the Kafka cluster | | listeners | list | `[{"configuration":{"brokers":[{"advertisedHost":"127.0.0.1","broker":0,"nodePort":32000}]},"name":"external","port":9094,"tls":false,"type":"nodeport"}]` | Additional configurable listeners for connecting to brokers. | | namespaceOverride | string | `nil` | Optionally force the namespace that the resources in this stack are launched in. Without this, the default namespace that the Helm chart is being put into is used. It is recommended to keep this empty. | | strimzi-kafka-operator.enabled | bool | `true` | Set to `false` to intentionally disable installation of the Operator. This is useful if you are running this stack in a local dev environment where you might have multiple Kafka environments, and are already running the Strimzi operator. | @@ -58,6 +59,7 @@ project's development namespace. | strimzi-kafka-operator.resources | object | `{"limits":{"memory":"1Gi"},"requests":{"cpu":"250m","memory":"512Mi"}}` | Reconfigure the default resource requirements here so that the "requests" are as low as possible for memory (so we're not allocating any more memory than we absolutely must). | | strimzi-kafka-operator.watchAnyNamespace | bool | `true` | Because you can only install one Strimzi Operator helm chart in a cluster, we might as well set this to True. This allows the chart to be re-used (with `strimzi-kafka-operator.enabled: false`) by other local development projects. | | userName | string | `"user"` | Set the name of the KafkaUser that is created for local development | +| zookeeper.resources | object | `{"limits":{"cpu":null,"memory":null},"requests":{"cpu":null,"memory":null}}` | Optional resource requirements for the Zookeeper cluster | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) From 52ad7bf0ef5e9a3ec143146cbdfb2c9515e4e1da Mon Sep 17 00:00:00 2001 From: Philip Jacobs Date: Fri, 27 Sep 2024 17:05:55 -0700 Subject: [PATCH 4/5] set to empty map by default --- charts/local-kafka/values.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/charts/local-kafka/values.yaml b/charts/local-kafka/values.yaml index 6bf3053..787e109 100644 --- a/charts/local-kafka/values.yaml +++ b/charts/local-kafka/values.yaml @@ -26,22 +26,10 @@ kafka: # -- Optional resource requirements for the Kafka cluster resources: - limits: - cpu: - memory: - requests: - cpu: - memory: zookeeper: # -- Optional resource requirements for the Zookeeper cluster resources: - limits: - cpu: - memory: - requests: - cpu: - memory: # -- Additional configurable listeners for connecting to brokers. listeners: From e3f70a4c3fdd8704d7a2fa3e000d49d9c0943526 Mon Sep 17 00:00:00 2001 From: Philip Jacobs Date: Mon, 30 Sep 2024 09:16:25 -0700 Subject: [PATCH 5/5] helm docs --- charts/local-kafka/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/local-kafka/README.md b/charts/local-kafka/README.md index 9f0c1a3..da7597d 100644 --- a/charts/local-kafka/README.md +++ b/charts/local-kafka/README.md @@ -45,7 +45,7 @@ project's development namespace. | kafka.interBrokerProtocolVersion | `str` | `nil` | Optional value for the inter.broker.protocol.version property (eg. `2.8`) | | kafka.logMessageFormatVersion | `str` | `nil` | Optional value for the log.message.format.version property (eg, `2.7`) | | kafka.priorityClassName | `str` | `nil` | Optional value for the kafka cluster pod priority class name | -| kafka.resources | object | `{"limits":{"cpu":null,"memory":null},"requests":{"cpu":null,"memory":null}}` | Optional resource requirements for the Kafka cluster | +| kafka.resources | string | `nil` | Optional resource requirements for the Kafka cluster | | listeners | list | `[{"configuration":{"brokers":[{"advertisedHost":"127.0.0.1","broker":0,"nodePort":32000}]},"name":"external","port":9094,"tls":false,"type":"nodeport"}]` | Additional configurable listeners for connecting to brokers. | | namespaceOverride | string | `nil` | Optionally force the namespace that the resources in this stack are launched in. Without this, the default namespace that the Helm chart is being put into is used. It is recommended to keep this empty. | | strimzi-kafka-operator.enabled | bool | `true` | Set to `false` to intentionally disable installation of the Operator. This is useful if you are running this stack in a local dev environment where you might have multiple Kafka environments, and are already running the Strimzi operator. | @@ -59,7 +59,7 @@ project's development namespace. | strimzi-kafka-operator.resources | object | `{"limits":{"memory":"1Gi"},"requests":{"cpu":"250m","memory":"512Mi"}}` | Reconfigure the default resource requirements here so that the "requests" are as low as possible for memory (so we're not allocating any more memory than we absolutely must). | | strimzi-kafka-operator.watchAnyNamespace | bool | `true` | Because you can only install one Strimzi Operator helm chart in a cluster, we might as well set this to True. This allows the chart to be re-used (with `strimzi-kafka-operator.enabled: false`) by other local development projects. | | userName | string | `"user"` | Set the name of the KafkaUser that is created for local development | -| zookeeper.resources | object | `{"limits":{"cpu":null,"memory":null},"requests":{"cpu":null,"memory":null}}` | Optional resource requirements for the Zookeeper cluster | +| zookeeper.resources | string | `nil` | Optional resource requirements for the Zookeeper cluster | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)