Skip to content

Commit

Permalink
Merge pull request #259 from RafalKorepta/rk/gh-priv-3/production-set…
Browse files Browse the repository at this point in the history
…tings

Add production tunable configuration
  • Loading branch information
Rafal Korepta authored Jan 13, 2023
2 parents e228c87 + 28baf5e commit acec179
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/redpanda/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type: application
# The chart version and the app version are not the same and will not track
# together. The chart version is a semver representation of changes to this
# chart.
version: 2.4.4
version: 2.4.5

# The app version is the default version of Redpanda to install.
appVersion: v22.3.10
Expand Down
18 changes: 18 additions & 0 deletions charts/redpanda/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,24 @@ IP is required for the advertised address.
{{- end -}}
{{- end -}}
{{- define "tunable" -}}
{{- $tunable := dig "tunable" dict .Values.config }}
{{- if (include "redpanda-atleast-22-3-0" . | fromJson).bool }}
{{- toYaml $tunable | nindent 4 }}
{{- else if (include "redpanda-atleast-22-2-0" . | fromJson).bool }}
{{- $tunable = unset $tunable "log_segment_size_min" }}
{{- $tunable = unset $tunable "log_segment_size_max" }}
{{- $tunable = unset $tunable "kafka_batch_max_bytes" }}
{{- toYaml $tunable | nindent 4 }}
{{- else if (include "redpanda-atleast-22-1-1" . | fromJson).bool }}
{{- $tunable = unset $tunable "log_segment_size_min" }}
{{- $tunable = unset $tunable "log_segment_size_max" }}
{{- $tunable = unset $tunable "kafka_batch_max_bytes" }}
{{- $tunable = unset $tunable "topic_partitions_per_shard" }}
{{- toYaml $tunable | nindent 4 }}
{{- end }}
{{- end }}
{{- define "redpanda-atleast-22-1-1" -}}
{{- toJson (dict "bool" (or (not (eq .Values.image.repository "vectorized/redpanda")) (include "redpanda.semver" . | semverCompare ">=22.1.1"))) -}}
{{- end -}}
Expand Down
6 changes: 2 additions & 4 deletions charts/redpanda/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ data:
{{- with (dig "cluster" dict .Values.config) }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with (dig "tunable" dict .Values.config) }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- include "tunable" . }}
{{- if and (not (hasKey .Values.config.cluster "storage_min_free_bytes")) ((include "redpanda-atleast-22-2-0" . | fromJson).bool) }}
storage_min_free_bytes: {{ include "storage-min-free-bytes" . }}
{{- end }}
Expand Down Expand Up @@ -81,7 +79,7 @@ data:
{{- with (dig "tunable" dict .Values.config) }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if not (hasKey "storage_min_free_bytes" .Values.config.cluster) }}
{{- if not (hasKey .Values.config.cluster "storage_min_free_bytes") }}
storage_min_free_bytes: {{ include "storage-min-free-bytes" . }}
{{- end }}
{{- end }}
Expand Down
14 changes: 13 additions & 1 deletion charts/redpanda/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,19 @@ config:
# tm_sync_timeout_ms: 2000ms # Time to wait state catch up before rejecting a request
# tm_violation_recovery_policy: crash # Describes how to recover from an invariant violation happened on the transaction coordinator level
# transactional_id_expiration_ms: 10080min # Producer ids are expired once this time has elapsed after the last write with the given producer ID
tunable: {}
tunable:
log_segment_size: 134217728 # 128 mb
log_segment_size_min: 16777216 # 16 mb
log_segment_size_max: 268435456 # 256 mb
kafka_batch_max_bytes: 1048576 # 1 mb
topic_partitions_per_shard: 1000
compacted_log_segment_size: 67108864 # 64 mb
max_compacted_log_segment_size: 536870912 # 512 mb
kafka_connection_rate_limit: 1000
group_topic_partitions: 16
# cloud_storage_enable_remote_read: true # cluster wide configuration for read from remote cloud storage
# cloud_storage_enable_remote_write: true # cluster wide configuration for writing to remote cloud storage

# alter_topic_cfg_timeout_ms: 5s # Time to wait for entries replication in controller log when executing alter configuration request
# compacted_log_segment_size: 256MiB # How large in bytes should each compacted log segment be (default 256MiB)
# controller_backend_housekeeping_interval_ms: 1s # Interval between iterations of controller backend housekeeping loop
Expand Down

0 comments on commit acec179

Please sign in to comment.