Skip to content

Commit 2629a6b

Browse files
committed
fix hardcode, add merge and resolve config
1 parent b7a51ba commit 2629a6b

6 files changed

Lines changed: 77 additions & 11 deletions

File tree

‎packages/apps/nats/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type: application
1616
# This is the chart version. This version number should be incremented each time you make changes
1717
# to the chart and its templates, including the app version.
1818
# Versions are expected to follow Semantic Versioning (https://semver.org/)
19-
version: 0.3.1
19+
version: 0.4.0
2020

2121
# This is the version number of the application being deployed. This version number should be
2222
# incremented each time you make changes to the application. Versions are not expected to

‎packages/apps/nats/README.md‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

55
### Common parameters
66

7-
| Name | Description | Value |
8-
| -------------- | ----------------------------------------------- | ------- |
9-
| `external` | Enable external access from outside the cluster | `false` |
10-
| `replicas` | Persistent Volume size for NATS | `2` |
11-
| `storageClass` | StorageClass used to store the data | `""` |
12-
| `users` | Users configuration | `{}` |
7+
| Name | Description | Value |
8+
| ------------------- | -------------------------------------------------- | ------- |
9+
| `external` | Enable external access from outside the cluster | `false` |
10+
| `replicas` | Persistent Volume size for NATS | `2` |
11+
| `storageClass` | StorageClass used to store the data | `""` |
12+
| `users` | Users configuration | `{}` |
13+
| `jetstream.size` | Jetstream persistent storage size | `10Gi` |
14+
| `jetstream.enabled` | Enable or disable Jetstream | `true` |
15+
| `config.merge` | Additional configuration to merge into NATS config | `{}` |
16+
| `config.resolver` | Additional configuration to merge into NATS config | `{}` |

‎packages/apps/nats/templates/nats.yaml‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,24 @@ spec:
4040
nats:
4141
fullnameOverride: {{ .Release.Name }}
4242
config:
43-
{{- if gt (len $passwords) 0 }}
43+
{{- if or (gt (len $passwords) 0) (gt (len .Values.config.merge) 0) }}
4444
merge:
45+
{{- if gt (len $passwords) 0 }}
4546
accounts:
4647
A:
4748
users:
4849
{{- range $username, $password := $passwords }}
4950
- user: "{{ $username }}"
5051
password: "{{ $password }}"
5152
{{- end }}
53+
{{- end }}
54+
{{- if and .Values.config (hasKey .Values.config "merge") }}
55+
{{ toYaml .Values.config.merge | nindent 12 }}
56+
{{- end }}
57+
{{- end }}
58+
{{- if and .Values.config (hasKey .Values.config "resolver") }}
59+
resolver:
60+
{{ toYaml .Values.config.resolver | nindent 12 }}
5261
{{- end }}
5362
cluster:
5463
enabled: true
@@ -58,10 +67,10 @@ spec:
5867
jetstream:
5968
enabled: true
6069
fileStore:
61-
enabled: true
70+
enabled: {{ .Values.jetstream.enabled }}
6271
pvc:
6372
enabled: true
64-
size: 10Gi
73+
size: {{ .Values.jetstream.size }}
6574
{{- with .Values.storageClass }}
6675
storageClassName: {{ . }}
6776
{{- end }}

‎packages/apps/nats/values.schema.json‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,36 @@
1616
"type": "string",
1717
"description": "StorageClass used to store the data",
1818
"default": ""
19+
},
20+
"jetstream": {
21+
"type": "object",
22+
"properties": {
23+
"size": {
24+
"type": "string",
25+
"description": "Jetstream persistent storage size",
26+
"default": "10Gi"
27+
},
28+
"enabled": {
29+
"type": "boolean",
30+
"description": "Enable or disable Jetstream",
31+
"default": true
32+
}
33+
}
34+
},
35+
"config": {
36+
"type": "object",
37+
"properties": {
38+
"merge": {
39+
"type": "object",
40+
"description": "Additional configuration to merge into NATS config",
41+
"default": {}
42+
},
43+
"resolver": {
44+
"type": "object",
45+
"description": "Additional configuration to merge into NATS config",
46+
"default": {}
47+
}
48+
}
1949
}
2050
}
2151
}

‎packages/apps/nats/values.yaml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,25 @@ storageClass: ""
1515
## password: strongpassword
1616
## user2: {}
1717
users: {}
18+
19+
jetstream:
20+
## @param jetstream.size Jetstream persistent storage size
21+
## Specifies the size of the persistent storage for Jetstream (message store).
22+
## Default: 10Gi
23+
size: 10Gi
24+
25+
## @param jetstream.enabled Enable or disable Jetstream
26+
## Set to true to enable Jetstream for persistent messaging in NATS.
27+
## Default: true
28+
enabled: true
29+
30+
config:
31+
## @param config.merge Additional configuration to merge into NATS config
32+
## Allows you to customize NATS server settings by merging additional configurations.
33+
## For example, you can add extra parameters, configure authentication, or set custom settings.
34+
## Default: {}
35+
merge: {}
36+
## @param config.resolver Additional configuration to merge into NATS config
37+
## Allows you to customize NATS server settings by merging resolver configurations.
38+
## Default: {}
39+
resolver: {}

‎packages/apps/versions_map‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ mysql 0.5.2 HEAD
5252
nats 0.1.0 5ca8823
5353
nats 0.2.0 c07c4bbd
5454
nats 0.3.0 78366f19
55-
nats 0.3.1 HEAD
55+
nats 0.3.1 b7375f73
56+
nats 0.4.0 HEAD
5657
postgres 0.1.0 f642698
5758
postgres 0.2.0 7cd7de73
5859
postgres 0.2.1 4a97e297

0 commit comments

Comments
 (0)