From b30b6c966d0fa12654815afa2a116062979eafe5 Mon Sep 17 00:00:00 2001 From: MEM3DR Date: Mon, 15 Jan 2024 12:51:00 +0100 Subject: [PATCH 1/5] add missing section in values.yaml for pulsar_metadata resources --- charts/pulsar/values.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 3798685b..e0af5cbd 100644 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -677,6 +677,12 @@ pulsar_metadata: configurationStoreMetadataPrefix: "" configurationStorePort: 2181 + # resources for bin/pulsar initialize-cluster-metadata + resources: +# requests: +# memory: 512Mi +# cpu: 1 + ## optional you can specify tolerations and nodeSelectors for all init jobs (pulsar-init & bookkeeper-init) # tolerations: [] # - key: "someKey" From ddc7676d51442b055bdbd52a6f7debf6eef0f48b Mon Sep 17 00:00:00 2001 From: MEM3DR Date: Mon, 15 Jan 2024 12:52:13 +0100 Subject: [PATCH 2/5] add resources to all init containers and an additional section to specify them in values.yaml --- .../templates/autorecovery-statefulset.yaml | 1 + .../bookkeeper-cluster-initialize.yaml | 1 + .../templates/bookkeeper-statefulset.yaml | 1 + .../pulsar/templates/broker-statefulset.yaml | 2 ++ .../pulsar/templates/proxy-statefulset.yaml | 2 ++ .../templates/pulsar-cluster-initialize.yaml | 3 +++ charts/pulsar/values.yaml | 25 +++++++++++++++++++ 7 files changed, 35 insertions(+) diff --git a/charts/pulsar/templates/autorecovery-statefulset.yaml b/charts/pulsar/templates/autorecovery-statefulset.yaml index 3d3b4ce8..2aa4f138 100644 --- a/charts/pulsar/templates/autorecovery-statefulset.yaml +++ b/charts/pulsar/templates/autorecovery-statefulset.yaml @@ -111,6 +111,7 @@ spec: - name: pulsar-bookkeeper-verify-clusterid image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.autorecovery "root" .) }}" imagePullPolicy: {{ .Values.images.autorecovery.pullPolicy }} + resources: {{ toYaml .Values.initContainer_resources.verify_cluster_id | nindent 10 }} command: ["sh", "-c"] args: - > diff --git a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml index 24aae920..009556d4 100644 --- a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml +++ b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml @@ -47,6 +47,7 @@ spec: - name: wait-zookeeper-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}" imagePullPolicy: {{ .Values.images.bookie.pullPolicy }} + resources: {{ toYaml .Values.initContainer_resources.zookeeper_ready | nindent 10 }} command: ["sh", "-c"] args: - >- diff --git a/charts/pulsar/templates/bookkeeper-statefulset.yaml b/charts/pulsar/templates/bookkeeper-statefulset.yaml index a81245ce..c5131981 100644 --- a/charts/pulsar/templates/bookkeeper-statefulset.yaml +++ b/charts/pulsar/templates/bookkeeper-statefulset.yaml @@ -112,6 +112,7 @@ spec: - name: pulsar-bookkeeper-verify-clusterid image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}" imagePullPolicy: {{ .Values.images.bookie.pullPolicy }} + resources: {{ toYaml .Values.initContainer_resources.verify_cluster_id | nindent 10 }} command: ["sh", "-c"] args: # only reformat bookie if bookkeeper is running without persistence diff --git a/charts/pulsar/templates/broker-statefulset.yaml b/charts/pulsar/templates/broker-statefulset.yaml index b436cfca..5f3c452f 100644 --- a/charts/pulsar/templates/broker-statefulset.yaml +++ b/charts/pulsar/templates/broker-statefulset.yaml @@ -110,6 +110,7 @@ spec: - name: wait-zookeeper-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.broker "root" .) }}" imagePullPolicy: {{ .Values.images.broker.pullPolicy }} + resources: {{ toYaml .Values.initContainer_resources.zookeeper_ready | nindent 10 }} command: ["sh", "-c"] args: - >- @@ -134,6 +135,7 @@ spec: - name: wait-bookkeeper-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.broker "root" .) }}" imagePullPolicy: {{ .Values.images.broker.pullPolicy }} + resources: {{ toYaml .Values.initContainer_resources.bookkeeper_ready | nindent 10 }} command: ["sh", "-c"] args: - > diff --git a/charts/pulsar/templates/proxy-statefulset.yaml b/charts/pulsar/templates/proxy-statefulset.yaml index d50559c2..2335d69b 100644 --- a/charts/pulsar/templates/proxy-statefulset.yaml +++ b/charts/pulsar/templates/proxy-statefulset.yaml @@ -110,6 +110,7 @@ spec: - name: wait-zookeeper-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.proxy "root" .) }}" imagePullPolicy: {{ .Values.images.proxy.pullPolicy }} + resources: {{ toYaml .Values.initContainer_resources.zookeeper_ready | nindent 10 }} command: ["sh", "-c"] args: - >- @@ -128,6 +129,7 @@ spec: - name: wait-broker-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.proxy "root" .) }}" imagePullPolicy: {{ .Values.images.proxy.pullPolicy }} + resources: {{ toYaml .Values.initContainer_resources.broker_ready | nindent 10 }} command: ["sh", "-c"] args: - >- diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index 813950b0..2fdaa336 100644 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -44,6 +44,7 @@ spec: - name: wait-cs-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }} + resources: {{ toYaml .Values.initContainer_resources.cs_ready | nindent 10 }} command: ["sh", "-c"] args: - >- @@ -54,6 +55,7 @@ spec: - name: wait-zookeeper-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }} + resources: {{ toYaml .Values.initContainer_resources.zookeeper_ready | nindent 10 }} command: ["sh", "-c"] args: - >- @@ -72,6 +74,7 @@ spec: - name: pulsar-bookkeeper-verify-clusterid image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }} + resources: {{ toYaml .Values.initContainer_resources.verify_cluster_id | nindent 10 }} command: ["sh", "-c"] args: - > diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index e0af5cbd..9e618d12 100644 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -1157,3 +1157,28 @@ job: ttl: enabled: false secondsAfterFinished: 3600 + +# This section is intended for cluster providers where all containers, including init containers, +# need to provide the number of resources they are going to use. +initContainer_resources: + zookeeper_ready: + requests: + memory: 128Mi + cpu: 0.1 + cs_ready: + requests: + memory: 128Mi + cpu: 0.1 + verify_cluster_id: + requests: + memory: 128Mi + cpu: 0.1 + broker_ready: + requests: + memory: 128Mi + cpu: 0.1 + bookkeeper_ready: + requests: + memory: 128Mi + cpu: 0.1 + From 6b93ac975c858c796be907a8c9bfd1fe646a0f82 Mon Sep 17 00:00:00 2001 From: MEM3DR Date: Mon, 15 Jan 2024 15:10:26 +0100 Subject: [PATCH 3/5] increase memory defaults for init containers --- charts/pulsar/values.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 9e618d12..85dd4020 100644 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -1163,22 +1163,22 @@ job: initContainer_resources: zookeeper_ready: requests: - memory: 128Mi + memory: 256Mi cpu: 0.1 cs_ready: requests: - memory: 128Mi + memory: 256Mi cpu: 0.1 verify_cluster_id: requests: - memory: 128Mi + memory: 256Mi cpu: 0.1 broker_ready: requests: - memory: 128Mi + memory: 256Mi cpu: 0.1 bookkeeper_ready: requests: - memory: 128Mi + memory: 256Mi cpu: 0.1 From f6e696c980f491a8b97a370aad72abf117a6791b Mon Sep 17 00:00:00 2001 From: MEM3DR Date: Mon, 15 Jan 2024 15:26:27 +0100 Subject: [PATCH 4/5] remove empty lines --- charts/pulsar/values.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 85dd4020..7bb44ff8 100644 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -1180,5 +1180,4 @@ initContainer_resources: bookkeeper_ready: requests: memory: 256Mi - cpu: 0.1 - + cpu: 0.1 \ No newline at end of file From 692c114f97b7a5dfddf31c222231b5394c8a3c41 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Mon, 15 Jan 2024 17:41:52 +0200 Subject: [PATCH 5/5] Add newline to end of file --- charts/pulsar/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 7bb44ff8..51259543 100644 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -1180,4 +1180,4 @@ initContainer_resources: bookkeeper_ready: requests: memory: 256Mi - cpu: 0.1 \ No newline at end of file + cpu: 0.1