Support 'existing claims' for snapshotter pvc

This commit is contained in:
juan131
2019-06-21 11:47:22 -05:00
parent 2a14ca4cba
commit 2199a18599
7 changed files with 31 additions and 3 deletions
+3
View File
@@ -115,6 +115,7 @@ The following tables lists the configurable parameters of the etcd chart and the
| `disasterRecovery.cronjob.schedule` | Schedule in Cron format to save snapshots | `*/30 * * * *` |
| `disasterRecovery.cronjob.historyLimit` | Number of successful finished jobs to retain | `1` |
| `disasterRecovery.cronjob.podAnnotations` | Pod annotations for cronjob pods | `{}` |
| `disasterRecovery.pvc.existingClaim` | Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template. | `nil` |
| `disasterRecovery.pvc.size` | PVC Storage Request | `2Gi` |
| `disasterRecovery.pvc.storageClassName` | Storage Class for snapshots volume | `nfs` |
@@ -236,6 +237,8 @@ $ helm upgrade my-release bitnami/etcd \
--set statefulset.replicaCount=5
```
> **Note**: Scaling the statefulset with `kubectl scale ...` command is highly discouraged. Use `helm upgrade ...` for horizontal scaling so you ensure all the environment variables used to configure the ectd cluster are properly updated.
## Enable security for etcd
### Configure RBAC
+13
View File
@@ -78,6 +78,19 @@ Return the proper etcd data dir
{{- end -}}
{{- end -}}
{{/*
Return the proper Disaster Recovery PVC name
*/}}
{{- define "etcd.disasterRecovery.pvc.name" -}}
{{- if .Values.disasterRecovery.pvc.existingClaim -}}
{{- with .Values.disasterRecovery.pvc.existingClaim -}}
{{ tpl . $ }}
{{- end -}}
{{- else -}}
{{ template "etcd.fullname" . }}-snapshotter
{{- end -}}
{{- end -}}
{{/*
Return the proper etcdctl authentication options
*/}}
+1 -1
View File
@@ -64,5 +64,5 @@ spec:
defaultMode: 0755
- name: snapshot-volume
persistentVolumeClaim:
claimName: {{ template "etcd.fullname" . }}-snapshotter
claimName: {{ template "etcd.disasterRecovery.pvc.name" . }}
{{- end }}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- if .Values.disasterRecovery.enabled -}}
{{- if and .Values.disasterRecovery.enabled (not .Values.disasterRecovery.pvc.existingClaim) -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
+1 -1
View File
@@ -266,7 +266,7 @@ spec:
{{- if .Values.disasterRecovery.enabled }}
- name: snapshot-volume
persistentVolumeClaim:
claimName: {{ template "etcd.fullname" . }}-snapshotter
claimName: {{ template "etcd.disasterRecovery.pvc.name" . }}
{{- end }}
{{- if .Values.configFileConfigMap }}
- name: etcd-config
+6
View File
@@ -238,6 +238,12 @@ disasterRecovery:
##
# resources:
pvc:
## A manually managed Persistent Volume and Claim
## If defined, PVC must be created manually before volume will be bound
## The value is evaluated as a template, so, for example, the name can depend on .Release or .Chart
##
# existingClaim:
## PVC Storage Request
##
size: 2Gi
+6
View File
@@ -238,6 +238,12 @@ disasterRecovery:
##
# resources:
pvc:
## A manually managed Persistent Volume and Claim
## If defined, PVC must be created manually before volume will be bound
## The value is evaluated as a template, so, for example, the name can depend on .Release or .Chart
##
# existingClaim:
## PVC Storage Request
##
size: 2Gi