Skip to content

Commit

Permalink
apply autoscaling on sn-platform
Browse files Browse the repository at this point in the history
Signed-off-by: ericsyh <[email protected]>
  • Loading branch information
ericsyh committed Sep 22, 2024
1 parent b9a482d commit 1078502
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
11 changes: 11 additions & 0 deletions charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ spec:
replicas: {{ .Values.bookkeeper.replicaCount }}
image: "{{ .Values.images.bookie.repository }}:{{ .Values.images.bookie.tag }}"
imagePullPolicy: {{ .Values.images.bookie.pullPolicy }}
{{- if .Values.bookkeeper.autoScaling.enabled }}
autoScalingPolicy:
minReplicas: {{ .Values.bookkeeper.autoScaling.minReplicas }}
maxReplicas: {{ .Values.bookkeeper.autoScaling.maxReplicas }}
{{- if .Values.bookkeeper.autoScaling.metrics }}
metrics:
{{- with .Values.bookkeeper.autoScaling.metrics }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
logConfig:
level: {{ .Values.bookkeeper.logConfig.level }}
format: {{ .Values.bookkeeper.logConfig.format }}
Expand Down
11 changes: 11 additions & 0 deletions charts/sn-platform/templates/broker/broker-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ spec:
replicas: {{ .Values.broker.replicaCount }}
image: "{{ .Values.images.broker.repository }}:{{ .Values.images.broker.tag }}"
imagePullPolicy: {{ .Values.images.broker.pullPolicy }}
{{- if .Values.broker.autoScaling.enabled }}
autoScalingPolicy:
minReplicas: {{ .Values.broker.autoScaling.minReplicas }}
maxReplicas: {{ .Values.broker.autoScaling.maxReplicas }}
{{- if .Values.broker.autoScaling.metrics }}
metrics:
{{- with .Values.broker.autoScaling.metrics }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
logConfig:
level: {{ .Values.broker.logConfig.level }}
format: {{ .Values.broker.logConfig.format }}
Expand Down
16 changes: 16 additions & 0 deletions charts/sn-platform/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,14 @@ bookkeeper:
# annotations that will be added on the BookKeeperCluster CR only.
annotations: {}

# The field autoScaling will track the average metrics usage of the Pulsar nodes and adjusts the nodes to keep at the target metrics usage level.
# If the average metrics usage for nodes is over the target, scaling controller will scale out to bring more nodes and if the average metrics for the nodes is less than the target, scaling controller will downscale nodes to save resources.
autoScaling:
enabled: false
minReplicas: 1
maxReplicas: 4
metrics: {}

# The field logConfig can be used to change the log level and log format of pods.
# The logConfig field is optional. If it is not specified, the component will use the default log configuration /pulsar/conf/log4j2.yaml.
# If it is specified will dynamically change the log level and log format of the component by changing the CR.
Expand Down Expand Up @@ -1099,6 +1107,14 @@ broker:
# annotations that will be added on the PulsarBroker CR only.
annotations: {}

# The field autoScaling will track the average metrics usage of the Pulsar nodes and adjusts the nodes to keep at the target metrics usage level.
# If the average metrics usage for nodes is over the target, scaling controller will scale out to bring more nodes and if the average metrics for the nodes is less than the target, scaling controller will downscale nodes to save resources.
autoScaling:
enabled: false
minReplicas: 1
maxReplicas: 4
metrics: {}

# The field logConfig can be used to change the log level and log format of pods.
# The logConfig field is optional. If it is not specified, the component will use the default log configuration /pulsar/conf/log4j2.yaml.
# If it is specified will dynamically change the log level and log format of the component by changing the CR.
Expand Down

0 comments on commit 1078502

Please sign in to comment.