Skip to content

Commit fe158ac

Browse files
authored
feat: add retention policy to etcd sts pvc (#129)
* add retention policy to etcd sts pvc * run make on the documentation
1 parent 6ce1b5f commit fe158ac

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

charts/kamaji-etcd/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Here the values you can override:
104104
| peerApiPort | int | `2380` | The peer API port which servers are listening to. |
105105
| persistentVolumeClaim.accessModes | list | `["ReadWriteOnce"]` | The Access Mode to storage |
106106
| persistentVolumeClaim.customAnnotations | object | `{}` | The custom annotations to add to the PVC |
107+
| persistentVolumeClaim.retentionPolicyWhenDeleted | string | `"Retain"` | What happens to PVCs created when the StatefulSet is deleted. `Retain` causes PVCs to not be affected by StatefulSet deletion, `Delete` policy causes those PVCs to be deleted |
107108
| persistentVolumeClaim.size | string | `"8Gi"` | The size of persistent storage for etcd data |
108109
| persistentVolumeClaim.storageClassName | string | `""` | A specific storage class |
109110
| podAnnotations | object | `{}` | Annotations to add to all etcd pods |

charts/kamaji-etcd/templates/etcd_sts.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ spec:
1111
matchLabels:
1212
{{- include "etcd.selectorLabels" . | nindent 6 }}
1313
replicas: {{ .Values.replicas }}
14+
{{- if .Values.persistentVolumeClaim.retentionPolicyWhenDeleted }}
15+
persistentVolumeClaimRetentionPolicy:
16+
whenDeleted: {{ .Values.persistentVolumeClaim.retentionPolicyWhenDeleted }}
17+
{{- end }}
1418
template:
1519
metadata:
1620
name: etcd

charts/kamaji-etcd/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ persistentVolumeClaim:
7575
# -- The custom annotations to add to the PVC
7676
customAnnotations: {}
7777
# volumeType: local
78+
# -- What happens to PVCs created when the StatefulSet is deleted. `Retain` causes PVCs to not be affected by StatefulSet deletion, `Delete` policy causes those PVCs to be deleted
79+
retentionPolicyWhenDeleted: Retain
7880

7981
# -- Labels to add to all etcd pods
8082
podLabels:

0 commit comments

Comments
 (0)