Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 14 additions & 4 deletions contrib/charts/dragonfly/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dragonfly

![Version: v0.12.0](https://img.shields.io/badge/Version-v0.12.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.12.0](https://img.shields.io/badge/AppVersion-v0.12.0-informational?style=flat-square)
![Version: v1.34.2](https://img.shields.io/badge/Version-v1.34.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.34.2](https://img.shields.io/badge/AppVersion-v1.34.2-informational?style=flat-square)

Dragonfly is a modern in-memory datastore, fully compatible with Redis and Memcached APIs.

Expand Down Expand Up @@ -32,21 +32,29 @@ helm upgrade --install dragonfly oci://ghcr.io/dragonflydb/dragonfly/helm/dragon
|-----|------|---------|-------------|
| affinity | object | `{}` | Affinity for pod assignment |
| command | list | `[]` | Allow overriding the container's command |
| env | list | `[]` | extra environment variables |
| envFrom | list | `[]` | extra environment variables from K8s objects |
| extraArgs | list | `[]` | Extra arguments to pass to the dragonfly binary |
| extraContainers | list | `[]` | Additional sidecar containers |
| extraObjects | list | `[]` | extra K8s manifests to deploy |
| extraVolumeMounts | list | `[]` | Extra volume mounts corresponding to the volumes mounted above |
| extraVolumes | list | `[]` | Extra volumes to mount into the pods |
| fullnameOverride | string | `""` | String to fully override dragonfly.fullname |
| hostNetwork | bool | `false` | Set hostNetwork for pod |
| image.pullPolicy | string | `"IfNotPresent"` | Dragonfly image pull policy |
| image.repository | string | `"docker.dragonflydb.io/dragonflydb/dragonfly"` | Container Image Registry to pull the image from |
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | Container Registry Secret names in an array |
| initContainers | list | `[]` | A list of initContainers to run before each pod starts |
| mode | string | `"deployment"` | Valid values are "deployment" or "statefulset". |
| nameOverride | string | `""` | String to partially override dragonfly.fullname |
| nodeSelector | object | `{}` | Node labels for pod assignment |
| passwordFromSecret.enable | bool | `false` | |
| passwordFromSecret.existingSecret.key | string | `""` | |
| passwordFromSecret.existingSecret.name | string | `""` | |
| podAnnotations | object | `{}` | Annotations for pods |
| podSecurityContext | object | `{}` | Set securityContext for pod itself |
| priorityClassName | string | `""` | Priority class name for pod assignment |
| probes.livenessProbe.exec.command[0] | string | `"/bin/sh"` | |
| probes.livenessProbe.exec.command[1] | string | `"/usr/local/bin/healthcheck.sh"` | |
| probes.livenessProbe.failureThreshold | int | `3` | |
Expand All @@ -66,11 +74,11 @@ helm upgrade --install dragonfly oci://ghcr.io/dragonflydb/dragonfly/helm/dragon
| replicaCount | int | `1` | Number of replicas to deploy |
| resources.limits | object | `{}` | The resource limits for the containers |
| resources.requests | object | `{}` | The requested resources for the containers |
| env | list | `[]` | Extra environment variables |
| envFrom | list | `[]` | Extra environment variables from K8s objects |
| securityContext | object | `{}` | Set securityContext for containers |
| service.annotations | object | `{}` | Extra annotations for the service |
| service.clusterIP | string | `""` | Cluster IP address to assign to the service. Leave empty to auto-allocate |
| service.labels | object | `{}` | Extra labels for the service |
| service.loadBalancerIP | string | `""` | Load balancer static ip to use when service type is set to LoadBalancer |
| service.metrics.portName | string | `"metrics"` | name for the metrics port |
| service.metrics.serviceType | string | `"ClusterIP"` | serviceType for the metrics service |
| service.port | int | `6379` | Dragonfly service port |
Expand All @@ -92,10 +100,12 @@ helm upgrade --install dragonfly oci://ghcr.io/dragonflydb/dragonfly/helm/dragon
| tls.duration | string | `"87600h0m0s"` | duration or ttl of the validity of the created certificate |
| tls.enabled | bool | `false` | enable TLS |
| tls.existing_secret | string | `""` | use TLS certificates from existing secret |
| tls.issuer.group | string | `"cert-manager.io"` | group of the referenced issuer if you are using an external issuer, change this to that issuer group. |
| tls.issuer.kind | string | `"ClusterIssuer"` | cert-manager issuer kind. Usually Issuer or ClusterIssuer |
| tls.issuer.name | string | `"selfsigned"` | name of the referenced issuer |
| tls.key | string | `""` | TLS private key |
| tolerations | list | `[]` | Tolerations for pod assignment |
| topologySpreadConstraints | list | `[]` | Topology Spread Constraints for pod assignment |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
2 changes: 1 addition & 1 deletion contrib/charts/dragonfly/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if not .Values.storage.enabled }}
{{- if and (not .Values.storage.enabled) (eq .Values.mode "deployment") }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix backward compatibility. If .Values.mode is empty string or deployment then proceed with the deployment. So the default behaviour doesn't change (even if the mode is not present).

Copy link
Author

Choose a reason for hiding this comment

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

I set the mode in the values.yaml to “deployment” as the default. Shouldn’t that be sufficient as a fallback? I’ve actually prevented an empty mode value in the schema YAML.

Copy link
Contributor

Choose a reason for hiding this comment

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

let's make the old yaml configuration compatible with this change. Its ok to have an empty mode so that if someone wants to revert their configuration, it doesn't change the behaviour at all.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then remove this empty mode after a month or so.

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
4 changes: 3 additions & 1 deletion contrib/charts/dragonfly/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ metadata:
{{- end }}
{{- include "dragonfly.labels" . | nindent 4 }}
spec:
{{- if .Values.service.type }}
type: {{ .Values.service.type }}
{{- end }}
{{- if and (eq .Values.service.type "LoadBalancer") (ne .Values.service.loadBalancerIP "") }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.service.type "ClusterIP") (ne .Values.service.clusterIP "") }}
{{- if or (and (eq .Values.service.type "ClusterIP") (ne .Values.service.clusterIP "")) (eq .Values.service.type "") }}
clusterIP: {{ .Values.service.clusterIP }}
{{- end }}
ports:
Expand Down
4 changes: 3 additions & 1 deletion contrib/charts/dragonfly/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.storage.enabled }}
{{- if or (.Values.storage.enabled) (eq .Values.mode "statefulset") }}
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

The condition allows both deployment and statefulset to render when storage.enabled is true and mode is 'deployment'. This creates conflicting resources. The condition should be: {{- if or (and .Values.storage.enabled (ne .Values.mode \"deployment\")) (eq .Values.mode \"statefulset\") }} to ensure only one resource type is created.

Suggested change
{{- if or (.Values.storage.enabled) (eq .Values.mode "statefulset") }}
{{- if or (and .Values.storage.enabled (ne .Values.mode "deployment")) (eq .Values.mode "statefulset") }}

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

This change introduces a behavioral difference compared to the previous implementation.
Previously, setting storage.enabled=true automatically switched the deployment type from Deployment to StatefulSet.

With this update, users must explicitly set mode: "statefulset" to deploy Dragonfly as a StatefulSet — even if persistence is enabled.

While this change provides clearer and more predictable configuration behavior, it may be considered breaking, as existing users relying on the implicit switch will need to update their values configuration.

Copy link
Contributor

Choose a reason for hiding this comment

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

if storage enabled and mode == "", then create statefulset. If mode is set explicitly, follow mode.

apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand All @@ -25,6 +25,7 @@ spec:
{{- include "dragonfly.selectorLabels" . | nindent 8 }}
spec:
{{- include "dragonfly.pod" . | trim | nindent 6 }}
{{- if .Values.storage.enabled }}
volumeClaimTemplates:
- metadata:
name: "{{ .Release.Name }}-data"
Expand All @@ -34,4 +35,5 @@ spec:
resources:
requests:
storage: {{ .Values.storage.requests }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions contrib/charts/dragonfly/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# -- Number of replicas to deploy
replicaCount: 1

# -- Valid values are "deployment" or "statefulset".
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

The mode field lacks validation. Consider adding validation logic or a comment noting that invalid values will result in no workload being created, which could be confusing for users. Alternatively, implement a validation rule in the templates that produces a clear error message for invalid mode values.

Suggested change
# -- Valid values are "deployment" or "statefulset".
# -- Valid values are "deployment" or "statefulset". Setting any other value will result in no workload being created.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

I would prefer to add a values.schema.json; I’ll include it shortly. This should help ensure proper validation and make the configuration more robust.

mode: "deployment"

image:
# -- Container Image Registry to pull the image from
repository: docker.dragonflydb.io/dragonflydb/dragonfly
Expand Down
Loading