From 5445e60fb6d72d35dc99b51d037aa8b795421751 Mon Sep 17 00:00:00 2001 From: Caleb Lloyd Date: Thu, 24 Mar 2022 13:12:14 -0400 Subject: [PATCH] [nats helm] js enable fileStorage by default Signed-off-by: Caleb Lloyd --- examples/helm-do-nats-js-cluster.yaml | 2 +- helm/charts/nats/Chart.yaml | 2 +- helm/charts/nats/README.md | 34 +++++++++++++++++---------- helm/charts/nats/values.yaml | 6 ++--- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/examples/helm-do-nats-js-cluster.yaml b/examples/helm-do-nats-js-cluster.yaml index 3e36f7d9..9b649434 100644 --- a/examples/helm-do-nats-js-cluster.yaml +++ b/examples/helm-do-nats-js-cluster.yaml @@ -10,7 +10,7 @@ nats: fileStorage: enabled: true - size: "1Gi" + size: "10Gi" storageDirectory: /data/ storageClassName: do-block-storage diff --git a/helm/charts/nats/Chart.yaml b/helm/charts/nats/Chart.yaml index 52302af3..7d22a273 100644 --- a/helm/charts/nats/Chart.yaml +++ b/helm/charts/nats/Chart.yaml @@ -8,7 +8,7 @@ keywords: - nats - messaging - cncf -version: 0.14.2 +version: 0.15.0 home: http://github.com/nats-io/k8s maintainers: - name: Waldemar Quevedo diff --git a/helm/charts/nats/README.md b/helm/charts/nats/README.md index 30bfe14b..a11b125a 100644 --- a/helm/charts/nats/README.md +++ b/helm/charts/nats/README.md @@ -11,6 +11,17 @@ helm install my-nats nats/nats ## Breaking Change Log +- **0.15.0**: For users with JetStream enabled (`nats.jetstream.enabled = true`): `nats.jetstream.fileStorage.enabled` now defaults to `true` and `nats.jetstream.fileStorage.size` now defaults to `10Gi`. This updates the StatefulSet `spec.volumeClaimTemplates` field, which is immutable and cannot be changed on an existing StatefulSet; to upgrade from an older chart version, add the value: + ```yaml + nats: + jetstream: + fileStorage: + # add if enabled was previously the default setting + # not recommended; it would be better to migrate to a StatefulSet with storage enabled + enabled: false + # add if size was previously the default setting + size: 1Gi + ``` - **0.12.0**: The `podManagementPolicy` value was introduced and set to `Parallel` by default, which controls the StatefulSet `spec.podManagementPolicy` field. This field is immutable and cannot be changed on an existing StatefulSet; to upgrade from an older chart version, add the value: ```yaml podManagementPolicy: OrderedReady @@ -22,7 +33,7 @@ helm install my-nats nats/nats ```yaml nats: - image: nats:2.6.5-alpine + image: nats:2.7.4-alpine pullPolicy: IfNotPresent ``` @@ -364,6 +375,8 @@ auth: ### Setting up Memory and File Storage +File Storage is **always** recommended, since JetStream's RAFT Meta Group will be persisted to file storage. The Storage Class used should be block storage. NFS is not recommended. + ```yaml nats: image: nats:alpine @@ -377,8 +390,8 @@ nats: fileStorage: enabled: true - size: 1Gi - storageDirectory: /data/ + size: 10Gi + # storageClassName: gp2 # NOTE: AWS setup but customize as needed for your infra. ``` ### Using with an existing PersistentVolumeClaim @@ -433,8 +446,7 @@ nats: fileStorage: enabled: true - size: "1Gi" - storageDirectory: /data/ + size: "10Gi" cluster: enabled: true @@ -458,9 +470,8 @@ nats: fileStorage: enabled: true - size: "8Gi" - storageDirectory: /data/ - storageClassName: gp2 + size: "10Gi" + # storageClassName: gp2 # NOTE: AWS setup but customize as needed for your infra. cluster: enabled: true @@ -562,7 +573,7 @@ Now we start the server with the NATS Account Resolver (`auth.resolver.type=full ```yaml nats: - image: nats:2.6.1-alpine + image: nats:2.7.4-alpine logging: debug: false @@ -577,9 +588,8 @@ nats: fileStorage: enabled: true - size: "4Gi" - storageDirectory: /data/ - storageClassName: gp2 # NOTE: AWS setup but customize as needed for your infra. + size: "10Gi" + # storageClassName: gp2 # NOTE: AWS setup but customize as needed for your infra. cluster: enabled: true diff --git a/helm/charts/nats/values.yaml b/helm/charts/nats/values.yaml index 081c911d..7d1f7b0e 100644 --- a/helm/charts/nats/values.yaml +++ b/helm/charts/nats/values.yaml @@ -207,16 +207,16 @@ nats: # # ############################ fileStorage: - enabled: false + enabled: true storageDirectory: /data # Set for use with existing PVC # existingClaim: jetstream-pvc - # claimStorageSize: 1Gi + # claimStorageSize: 10Gi # Use below block to create new persistent volume # only used if existingClaim is not specified - size: 1Gi + size: 10Gi # storageClassName: "" accessModes: - ReadWriteOnce