Skip to content

Commit

Permalink
Merge pull request #475 from nats-io/feature/js-storage-default
Browse files Browse the repository at this point in the history
[nats helm] js enable fileStorage by default
  • Loading branch information
caleblloyd committed Mar 24, 2022
2 parents e0159f4 + 5445e60 commit e808a27
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
2 changes: 1 addition & 1 deletion examples/helm-do-nats-js-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nats:

fileStorage:
enabled: true
size: "1Gi"
size: "10Gi"
storageDirectory: /data/
storageClassName: do-block-storage

Expand Down
2 changes: 1 addition & 1 deletion helm/charts/nats/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 22 additions & 12 deletions helm/charts/nats/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -433,8 +446,7 @@ nats:
fileStorage:
enabled: true
size: "1Gi"
storageDirectory: /data/
size: "10Gi"
cluster:
enabled: true
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions helm/charts/nats/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e808a27

Please sign in to comment.