Skip to content

[bitnami/valkey-cluster] Add support for templating nodes, replicas, resources, and persistent storage values #32520

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mbrancato
Copy link

@mbrancato mbrancato commented Mar 19, 2025

Description of the change

This PR adds support to template the values input for the nodes, replicas, resources, and persistent storage of a cluster.

Benefits

Currently, this helm chart does not allow configuration by shard. This PR allows for abstraction when used as a subchart, or when the user just wants to configure things differently.

For example, this abstraction becomes possible:

global:
  cache:
    shards: 18
    replicas: 3

cluster:
  nodes: "{{ .Values.global.cache.shards | int | mul .Values.global.cache.replicas | int }}"
  replicas: "{{ .Values.global.cache.replicas }}"

Possible drawbacks

This should be compatible with all existing usage.

Additional information

Checklist

  • Chart version bumped in Chart.yaml according to semver. This is not necessary when the changes only affect README.md files.
  • Variables are documented in the values.yaml and added to the README.md using readme-generator-for-helm
  • Title of the pull request follows this pattern [bitnami/<name_of_the_chart>] Descriptive title
  • All commits signed off and in agreement of Developer Certificate of Origin (DCO)

mbrancato and others added 4 commits March 19, 2025 16:16
Signed-off-by: Mike Brancato <[email protected]>
Signed-off-by: Bitnami Bot <[email protected]>
Signed-off-by: Bitnami Bot <[email protected]>
@mbrancato mbrancato changed the title [bitnami/valkey-cluster] Add support for templating node and replica values [bitnami/valkey-cluster] Add support for templating nodes, replicas, resources, and persistent storage values Mar 20, 2025
bitnami-bot and others added 2 commits March 20, 2025 04:27
Signed-off-by: Bitnami Bot <[email protected]>
@carrodher carrodher added verify Execute verification workflow for these changes in-progress labels Mar 21, 2025
@github-actions github-actions bot removed the triage Triage is needed label Mar 21, 2025
@github-actions github-actions bot removed the request for review from javsalgar March 21, 2025 08:09
@github-actions github-actions bot requested a review from migruiz4 March 21, 2025 08:09
Signed-off-by: Bitnami Bot <[email protected]>
Copy link

github-actions bot commented Apr 6, 2025

This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.

@github-actions github-actions bot added the stale 15 days without activity label Apr 6, 2025
Copy link
Member

@migruiz4 migruiz4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mbrancato,

Thank you very much for your contribution! Could you please take a look at my comment?

@@ -20,7 +20,7 @@ spec:
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.valkey.podLabels .Values.commonLabels ) "context" . ) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
replicas: {{ .Values.cluster.nodes }}
replicas: {{ if eq (typeOf .Values.cluster.nodes) "float64" -}}{{ .Values.cluster.nodes }}{{- else -}}{{ tpl .Values.cluster.nodes . | int }}{{- end }}
Copy link
Member

@migruiz4 migruiz4 Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry but I'm not understanding, why the typeOf is required? Can't this be simplified like this?

Suggested change
replicas: {{ if eq (typeOf .Values.cluster.nodes) "float64" -}}{{ .Values.cluster.nodes }}{{- else -}}{{ tpl .Values.cluster.nodes . | int }}{{- end }}
replicas: {{ tpl .Values.cluster.nodes . | int }}

For those values that need to be quoted, like environment variables values: {{ tpl .Values.cluster.nodes $ | int | quote }}

@github-actions github-actions bot removed the stale 15 days without activity label Apr 10, 2025
Copy link

This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.

@github-actions github-actions bot added the stale 15 days without activity label Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-progress stale 15 days without activity valkey-cluster verify Execute verification workflow for these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants