Skip to content

Commit

Permalink
enable persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurt108 committed Jul 24, 2021
1 parent e3ddeed commit 45de782
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/statping/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: statping
icon: https://camo.githubusercontent.com/adc90af589fd69235a49fc1e71eb55d6a9a9890c786ebcd578d1ac04fe8a884f/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f676974696d67732f7374617470696e672e706e67
version: 0.0.1
version: 0.0.2
appVersion: "v.0.90.74"
description: A chart containing statping
home: https://github.com/statping/statping
Expand Down
2 changes: 1 addition & 1 deletion charts/statping/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A chart containing statping

0.0.1
0.0.2

Installing the Chart

Expand Down
12 changes: 12 additions & 0 deletions charts/statping/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ spec:
app: {{ template "statping.name" . }}
release: {{ .Release.Name }}
spec:
volumes:
- name: {{ template "statping.fullname" . }}-storage
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "statping.fullname" .) }}-storage
{{- else }}
emptyDir: {}
{{ end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand All @@ -36,3 +44,7 @@ spec:
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
volumeMounts:
- name: {{ template "statping.fullname" . }}-storage
mountPath: /app
readOnly: false
27 changes: 27 additions & 0 deletions charts/statping/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "statping.fullname" . }}-storage
{{- with .Values.persistence.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
labels:
app: {{ template "statping.fullname" . }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/statping/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ service:

resources: {}

persistence:
enabled: false
storageClass: generic
accessMode: ReadWriteOnce
size: 8Gi

0 comments on commit 45de782

Please sign in to comment.