diff --git a/bitnami/nats/CHANGELOG.md b/bitnami/nats/CHANGELOG.md
index 48923dc85e58bd..69c3e58640dcad 100644
--- a/bitnami/nats/CHANGELOG.md
+++ b/bitnami/nats/CHANGELOG.md
@@ -1,8 +1,12 @@
# Changelog
-## 8.3.5 (2024-09-06)
+## 8.4.0 (2024-09-12)
-* [bitnami/nats] Release 8.3.5 ([#29253](https://github.com/bitnami/charts/pull/29253))
+* [bitnami/nats] Add `PersistentVolumeRetentionPolicy` ([#29371](https://github.com/bitnami/charts/pull/29371))
+
+## 8.3.5 (2024-09-06)
+
+* [bitnami/nats] Release 8.3.5 (#29253) ([a1687c9](https://github.com/bitnami/charts/commit/a1687c981454b4ec06fbc05993a6c498e5b29bcd)), closes [#29253](https://github.com/bitnami/charts/issues/29253)
## 8.3.4 (2024-08-30)
diff --git a/bitnami/nats/Chart.yaml b/bitnami/nats/Chart.yaml
index 7d5b4bb311a60b..b5a137237dfe11 100644
--- a/bitnami/nats/Chart.yaml
+++ b/bitnami/nats/Chart.yaml
@@ -31,4 +31,4 @@ maintainers:
name: nats
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/nats
-version: 8.3.5
+version: 8.4.0
diff --git a/bitnami/nats/README.md b/bitnami/nats/README.md
index 15302d20dee3cc..8d178c440a42a4 100644
--- a/bitnami/nats/README.md
+++ b/bitnami/nats/README.md
@@ -337,14 +337,17 @@ As an alternative, you can use of the preset configurations for pod affinity, po
### Persistence parameters
-| Name | Description | Value |
-| -------------------------- | ------------------------------------------------------------------- | ------------------- |
-| `persistence.enabled` | Enable NATS data persistence using PVC(s) | `false` |
-| `persistence.storageClass` | PVC Storage Class for NATS data volume | `""` |
-| `persistence.accessModes` | PVC Access modes | `["ReadWriteOnce"]` |
-| `persistence.size` | PVC Storage Request for NATS data volume | `8Gi` |
-| `persistence.annotations` | Annotations for the PVC | `{}` |
-| `persistence.selector` | Selector to match an existing Persistent Volume for NATS's data PVC | `{}` |
+| Name | Description | Value |
+| -------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------- |
+| `persistence.enabled` | Enable NATS data persistence using PVC(s) | `false` |
+| `persistence.storageClass` | PVC Storage Class for NATS data volume | `""` |
+| `persistence.accessModes` | PVC Access modes | `["ReadWriteOnce"]` |
+| `persistence.size` | PVC Storage Request for NATS data volume | `8Gi` |
+| `persistence.annotations` | Annotations for the PVC | `{}` |
+| `persistence.selector` | Selector to match an existing Persistent Volume for NATS's data PVC | `{}` |
+| `persistentVolumeClaimRetentionPolicy.enabled` | Enable Persistent volume retention policy for NATS statefulset | `false` |
+| `persistentVolumeClaimRetentionPolicy.whenScaled` | Volume retention behavior when the replica count of the StatefulSet is reduced | `Retain` |
+| `persistentVolumeClaimRetentionPolicy.whenDeleted` | Volume retention behavior that applies when the StatefulSet is deleted | `Retain` |
### Other parameters
@@ -461,4 +464,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
-limitations under the License.
\ No newline at end of file
+limitations under the License.
diff --git a/bitnami/nats/templates/statefulset.yaml b/bitnami/nats/templates/statefulset.yaml
index c58364984145a2..27a5483a09e378 100644
--- a/bitnami/nats/templates/statefulset.yaml
+++ b/bitnami/nats/templates/statefulset.yaml
@@ -224,6 +224,11 @@ spec:
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.persistence.enabled }}
+ {{- if .Values.persistentVolumeClaimRetentionPolicy.enabled }}
+ persistentVolumeClaimRetentionPolicy:
+ whenDeleted: {{ .Values.persistentVolumeClaimRetentionPolicy.whenDeleted }}
+ whenScaled: {{ .Values.persistentVolumeClaimRetentionPolicy.whenScaled }}
+ {{- end }}
volumeClaimTemplates:
- metadata:
name: data
diff --git a/bitnami/nats/values.yaml b/bitnami/nats/values.yaml
index 24b661dd376681..649eaacf810329 100644
--- a/bitnami/nats/values.yaml
+++ b/bitnami/nats/values.yaml
@@ -940,6 +940,19 @@ persistence:
## app: my-app
##
selector: {}
+## Persistent Volume Claim Retention Policy
+## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention
+##
+persistentVolumeClaimRetentionPolicy:
+ ## @param persistentVolumeClaimRetentionPolicy.enabled Enable Persistent volume retention policy for NATS statefulset
+ ##
+ enabled: false
+ ## @param persistentVolumeClaimRetentionPolicy.whenScaled Volume retention behavior when the replica count of the StatefulSet is reduced
+ ##
+ whenScaled: Retain
+ ## @param persistentVolumeClaimRetentionPolicy.whenDeleted Volume retention behavior that applies when the StatefulSet is deleted
+ ##
+ whenDeleted: Retain
## @section Other parameters
## NATS Pod Disruption Budget configuration
diff --git a/readme-generator b/readme-generator
new file mode 100755
index 00000000000000..70d142ac5c2ac9
Binary files /dev/null and b/readme-generator differ