diff --git a/packages/apps/nats/Chart.yaml b/packages/apps/nats/Chart.yaml index cbb30f92a..02b9fa18a 100644 --- a/packages/apps/nats/Chart.yaml +++ b/packages/apps/nats/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.1 +version: 0.4.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/packages/apps/nats/README.md b/packages/apps/nats/README.md index 96a59def4..239e86966 100644 --- a/packages/apps/nats/README.md +++ b/packages/apps/nats/README.md @@ -4,9 +4,13 @@ ### Common parameters -| Name | Description | Value | -| -------------- | ----------------------------------------------- | ------- | -| `external` | Enable external access from outside the cluster | `false` | -| `replicas` | Persistent Volume size for NATS | `2` | -| `storageClass` | StorageClass used to store the data | `""` | -| `users` | Users configuration | `{}` | +| Name | Description | Value | +| ------------------- | -------------------------------------------------- | ------- | +| `external` | Enable external access from outside the cluster | `false` | +| `replicas` | Persistent Volume size for NATS | `2` | +| `storageClass` | StorageClass used to store the data | `""` | +| `users` | Users configuration | `{}` | +| `jetstream.size` | Jetstream persistent storage size | `10Gi` | +| `jetstream.enabled` | Enable or disable Jetstream | `true` | +| `config.merge` | Additional configuration to merge into NATS config | `{}` | +| `config.resolver` | Additional configuration to merge into NATS config | `{}` | diff --git a/packages/apps/nats/templates/nats.yaml b/packages/apps/nats/templates/nats.yaml index 8a08ba3b4..3e843ccfd 100644 --- a/packages/apps/nats/templates/nats.yaml +++ b/packages/apps/nats/templates/nats.yaml @@ -40,8 +40,9 @@ spec: nats: fullnameOverride: {{ .Release.Name }} config: - {{- if gt (len $passwords) 0 }} + {{- if or (gt (len $passwords) 0) (gt (len .Values.config.merge) 0) }} merge: + {{- if gt (len $passwords) 0 }} accounts: A: users: @@ -49,6 +50,14 @@ spec: - user: "{{ $username }}" password: "{{ $password }}" {{- end }} + {{- end }} + {{- if and .Values.config (hasKey .Values.config "merge") }} + {{ toYaml .Values.config.merge | nindent 12 }} + {{- end }} + {{- end }} + {{- if and .Values.config (hasKey .Values.config "resolver") }} + resolver: + {{ toYaml .Values.config.resolver | nindent 12 }} {{- end }} cluster: enabled: true @@ -58,10 +67,10 @@ spec: jetstream: enabled: true fileStore: - enabled: true + enabled: {{ .Values.jetstream.enabled }} pvc: enabled: true - size: 10Gi + size: {{ .Values.jetstream.size }} {{- with .Values.storageClass }} storageClassName: {{ . }} {{- end }} diff --git a/packages/apps/nats/values.schema.json b/packages/apps/nats/values.schema.json index df176502f..8943647a6 100644 --- a/packages/apps/nats/values.schema.json +++ b/packages/apps/nats/values.schema.json @@ -16,6 +16,36 @@ "type": "string", "description": "StorageClass used to store the data", "default": "" + }, + "jetstream": { + "type": "object", + "properties": { + "size": { + "type": "string", + "description": "Jetstream persistent storage size", + "default": "10Gi" + }, + "enabled": { + "type": "boolean", + "description": "Enable or disable Jetstream", + "default": true + } + } + }, + "config": { + "type": "object", + "properties": { + "merge": { + "type": "object", + "description": "Additional configuration to merge into NATS config", + "default": {} + }, + "resolver": { + "type": "object", + "description": "Additional configuration to merge into NATS config", + "default": {} + } + } } } } \ No newline at end of file diff --git a/packages/apps/nats/values.yaml b/packages/apps/nats/values.yaml index 6b2205be7..57f6580cc 100644 --- a/packages/apps/nats/values.yaml +++ b/packages/apps/nats/values.yaml @@ -15,3 +15,49 @@ storageClass: "" ## password: strongpassword ## user2: {} users: {} + +jetstream: + ## @param jetstream.size Jetstream persistent storage size + ## Specifies the size of the persistent storage for Jetstream (message store). + ## Default: 10Gi + size: 10Gi + + ## @param jetstream.enabled Enable or disable Jetstream + ## Set to true to enable Jetstream for persistent messaging in NATS. + ## Default: true + enabled: true + +config: + ## @param config.merge Additional configuration to merge into NATS config + ## Allows you to customize NATS server settings by merging additional configurations. + ## For example, you can add extra parameters, configure authentication, or set custom settings. + ## Default: {} + ## example: + ## + ## merge: + ## $include: ./my-config.conf + ## zzz$include: ./my-config-last.conf + ## server_name: nats + ## authorization: + ## token: << $TOKEN >> + ## jetstream: + ## max_memory_store: << 1GB >> + ## + ## will yield the config: + ## { + ## include ./my-config.conf; + ## "authorization": { + ## "token": $TOKEN + ## }, + ## "jetstream": { + ## "max_memory_store": 1GB + ## }, + ## "server_name": "nats", + ## include ./my-config-last.conf; + ## } + merge: {} + ## @param config.resolver Additional configuration to merge into NATS config + ## Allows you to customize NATS server settings by merging resolver configurations. + ## Default: {} + ## Example see: https://github.com/nats-io/k8s/blob/main/helm/charts/nats/values.yaml#L247 + resolver: {} diff --git a/packages/apps/versions_map b/packages/apps/versions_map index 6ad48e5e5..10acaffd5 100644 --- a/packages/apps/versions_map +++ b/packages/apps/versions_map @@ -52,7 +52,8 @@ mysql 0.5.2 HEAD nats 0.1.0 5ca8823 nats 0.2.0 c07c4bbd nats 0.3.0 78366f19 -nats 0.3.1 HEAD +nats 0.3.1 b7375f73 +nats 0.4.0 HEAD postgres 0.1.0 f642698 postgres 0.2.0 7cd7de73 postgres 0.2.1 4a97e297