Install on Kubernetes with Helm Chart

This guide describes how to deploy Dragonfly on a Kubernetes cluster using Helm (See Install Helm).

Prerequisites

  • A Kubernetes cluster (see Kind or Minikube if you want to experiment locally).
  • Select the Dragonfly version:
  • For the latest version, set: VERSION=v1.12.1
  • Choose a version from here

Install a standalone master

Run this command:

helm upgrade --install dragonfly oci://ghcr.io/dragonflydb/dragonfly/helm/dragonfly --version $VERSION

Install a standalone master with snapshot taken every minute

  1. Add the following to the myvals.yaml values file (create a new file if it doesn’t exist):

``` 1. storage: 2. enabled: true 3. requests: 128Mi # Set as desired

  1. extraArgs:
    • --dbfilename=dump.rdb
    • --save_schedule=: # HH:MM glob format
  2. podSecurityContext:

  3. fsGroup: 2000

  4. securityContext:

  5. capabilities:
  6. drop:
    • ALL
  7. readOnlyRootFilesystem: true
  8. runAsNonRoot: true
  9. runAsUser: 1000 ```
  10. Run this command: helm upgrade -f myvals.yaml --install dragonfly oci://ghcr.io/dragonflydb/dragonfly/helm/dragonfly --version $VERSION

Integrate with Kube-Prometheus Monitoring

If you have Kube-Prometheus installed in your cluster, you set it to monitor your Dragonfly deployment by enabling the serviceMonitor and prometheusRule in your values file. For example:

1. serviceMonitor:
2. enabled: true

4. prometheusRule:
5. enabled: true
6. spec:
7. - alert: DragonflyMissing
8. expr: absent(dragonfly_uptime_in_seconds) == 1
9. for: 0m
10. labels:
11. severity: critical
12. annotations:
13. summary: Dragonfly is missing
14. description: "Dragonfly is missing"

More Customization

For more customization please see the Dragonfly Chart