Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource specs for Init Containers #428

Merged
merged 6 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/pulsar/templates/autorecovery-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- >
Expand Down
1 change: 1 addition & 0 deletions charts/pulsar/templates/bookkeeper-cluster-initialize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- >-
Expand Down
1 change: 1 addition & 0 deletions charts/pulsar/templates/bookkeeper-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions charts/pulsar/templates/broker-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- >-
Expand All @@ -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:
- >
Expand Down
2 changes: 2 additions & 0 deletions charts/pulsar/templates/proxy-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- >-
Expand All @@ -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:
- >-
Expand Down
3 changes: 3 additions & 0 deletions charts/pulsar/templates/pulsar-cluster-initialize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- >-
Expand All @@ -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:
- >-
Expand All @@ -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:
- >
Expand Down
30 changes: 30 additions & 0 deletions charts/pulsar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -1151,3 +1157,27 @@ 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: 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
Loading