Resource specs for Init Containers (#428)

* add missing section in values.yaml for pulsar_metadata resources

* add resources to all init containers and an additional section to specify them in values.yaml

* increase memory defaults for init containers

* remove empty lines

* Add newline to end of file
This commit is contained in:
Martin 2024-01-15 16:53:56 +01:00 committed by GitHub
parent 62569f4023
commit 04b8ccebb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 40 additions and 0 deletions

View File

@ -111,6 +111,7 @@ spec:
- name: pulsar-bookkeeper-verify-clusterid - name: pulsar-bookkeeper-verify-clusterid
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.autorecovery "root" .) }}" image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.autorecovery "root" .) }}"
imagePullPolicy: {{ .Values.images.autorecovery.pullPolicy }} imagePullPolicy: {{ .Values.images.autorecovery.pullPolicy }}
resources: {{ toYaml .Values.initContainer_resources.verify_cluster_id | nindent 10 }}
command: ["sh", "-c"] command: ["sh", "-c"]
args: args:
- > - >

View File

@ -47,6 +47,7 @@ spec:
- name: wait-zookeeper-ready - name: wait-zookeeper-ready
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}" image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}"
imagePullPolicy: {{ .Values.images.bookie.pullPolicy }} imagePullPolicy: {{ .Values.images.bookie.pullPolicy }}
resources: {{ toYaml .Values.initContainer_resources.zookeeper_ready | nindent 10 }}
command: ["sh", "-c"] command: ["sh", "-c"]
args: args:
- >- - >-

View File

@ -112,6 +112,7 @@ spec:
- name: pulsar-bookkeeper-verify-clusterid - name: pulsar-bookkeeper-verify-clusterid
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}" image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}"
imagePullPolicy: {{ .Values.images.bookie.pullPolicy }} imagePullPolicy: {{ .Values.images.bookie.pullPolicy }}
resources: {{ toYaml .Values.initContainer_resources.verify_cluster_id | nindent 10 }}
command: ["sh", "-c"] command: ["sh", "-c"]
args: args:
# only reformat bookie if bookkeeper is running without persistence # only reformat bookie if bookkeeper is running without persistence

View File

@ -110,6 +110,7 @@ spec:
- name: wait-zookeeper-ready - name: wait-zookeeper-ready
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.broker "root" .) }}" image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.broker "root" .) }}"
imagePullPolicy: {{ .Values.images.broker.pullPolicy }} imagePullPolicy: {{ .Values.images.broker.pullPolicy }}
resources: {{ toYaml .Values.initContainer_resources.zookeeper_ready | nindent 10 }}
command: ["sh", "-c"] command: ["sh", "-c"]
args: args:
- >- - >-
@ -134,6 +135,7 @@ spec:
- name: wait-bookkeeper-ready - name: wait-bookkeeper-ready
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.broker "root" .) }}" image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.broker "root" .) }}"
imagePullPolicy: {{ .Values.images.broker.pullPolicy }} imagePullPolicy: {{ .Values.images.broker.pullPolicy }}
resources: {{ toYaml .Values.initContainer_resources.bookkeeper_ready | nindent 10 }}
command: ["sh", "-c"] command: ["sh", "-c"]
args: args:
- > - >

View File

@ -110,6 +110,7 @@ spec:
- name: wait-zookeeper-ready - name: wait-zookeeper-ready
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.proxy "root" .) }}" image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.proxy "root" .) }}"
imagePullPolicy: {{ .Values.images.proxy.pullPolicy }} imagePullPolicy: {{ .Values.images.proxy.pullPolicy }}
resources: {{ toYaml .Values.initContainer_resources.zookeeper_ready | nindent 10 }}
command: ["sh", "-c"] command: ["sh", "-c"]
args: args:
- >- - >-
@ -128,6 +129,7 @@ spec:
- name: wait-broker-ready - name: wait-broker-ready
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.proxy "root" .) }}" image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.proxy "root" .) }}"
imagePullPolicy: {{ .Values.images.proxy.pullPolicy }} imagePullPolicy: {{ .Values.images.proxy.pullPolicy }}
resources: {{ toYaml .Values.initContainer_resources.broker_ready | nindent 10 }}
command: ["sh", "-c"] command: ["sh", "-c"]
args: args:
- >- - >-

View File

@ -44,6 +44,7 @@ spec:
- name: wait-cs-ready - name: wait-cs-ready
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}"
imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }} imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }}
resources: {{ toYaml .Values.initContainer_resources.cs_ready | nindent 10 }}
command: ["sh", "-c"] command: ["sh", "-c"]
args: args:
- >- - >-
@ -54,6 +55,7 @@ spec:
- name: wait-zookeeper-ready - name: wait-zookeeper-ready
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}"
imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }} imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }}
resources: {{ toYaml .Values.initContainer_resources.zookeeper_ready | nindent 10 }}
command: ["sh", "-c"] command: ["sh", "-c"]
args: args:
- >- - >-
@ -72,6 +74,7 @@ spec:
- name: pulsar-bookkeeper-verify-clusterid - name: pulsar-bookkeeper-verify-clusterid
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}"
imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }} imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }}
resources: {{ toYaml .Values.initContainer_resources.verify_cluster_id | nindent 10 }}
command: ["sh", "-c"] command: ["sh", "-c"]
args: args:
- > - >

View File

@ -677,6 +677,12 @@ pulsar_metadata:
configurationStoreMetadataPrefix: "" configurationStoreMetadataPrefix: ""
configurationStorePort: 2181 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) ## optional you can specify tolerations and nodeSelectors for all init jobs (pulsar-init & bookkeeper-init)
# tolerations: [] # tolerations: []
# - key: "someKey" # - key: "someKey"
@ -1151,3 +1157,27 @@ job:
ttl: ttl:
enabled: false enabled: false
secondsAfterFinished: 3600 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: 256Mi
cpu: 0.1
cs_ready:
requests:
memory: 256Mi
cpu: 0.1
verify_cluster_id:
requests:
memory: 256Mi
cpu: 0.1
broker_ready:
requests:
memory: 256Mi
cpu: 0.1
bookkeeper_ready:
requests:
memory: 256Mi
cpu: 0.1