Skip to content

Commit

Permalink
Add support for PVC into the chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Frostman committed Jan 23, 2018
1 parent 779dc9a commit 6cc4472
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
3 changes: 3 additions & 0 deletions charts/aptomi/templates/aptomi/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ data:
api:
host: 0.0.0.0
db:
connection: /etc/aptomi/data/db.bolt
enforcer:
disabled: false
Expand Down
17 changes: 14 additions & 3 deletions charts/aptomi/templates/aptomi/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ metadata:
spec:
replicas: 1
strategy:
rollingUpdate:
maxUnavailable: 0
type: Recreate
template:
metadata:
annotations:
Expand All @@ -26,6 +25,8 @@ spec:
volumeMounts:
- name: aptomi-config
mountPath: /etc/aptomi
- name: aptomi-db
mountPath: /etc/aptomi/data
readinessProbe:
exec:
command: [ "/bin/sh", "-ce", "wget -O - -T {{ .Values.probePeriodSeconds }} -q localhost:{{ .Values.port }}/version | grep gitversion" ]
Expand All @@ -41,4 +42,14 @@ spec:
- key: aptomi-config
path: config.yml
- key: aptomi-secrets
path: secrets.yaml
path: secrets.yaml
- name: aptomi-db
{{- if eq .Values.persistence.type "PersistentVolumeClaim" }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}
{{- else if eq .Values.persistence.type "emptyDir" }}
emptyDir: {}
{{- else if eq .Values.persistence.type "hostPath" }}
hostPath:
path: "{{ .Values.persistence.hostPath }}"
{{- end }}
20 changes: 20 additions & 0 deletions charts/aptomi/templates/aptomi/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if eq .Values.persistence.type "PersistentVolumeClaim" }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
{{- if .Values.persistence.storageClass }}
volume.beta.kubernetes.io/storage-class: "{{ .Values.persistence.storageClass }}"
{{- end }}
name: {{ template "fullname" . }}
labels:
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
app: {{ template "fullname" . }}
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: "{{ .Values.persistence.volumeSize }}"
{{- end -}}
8 changes: 8 additions & 0 deletions charts/aptomi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ service:
loadBalancerSourceRanges: []

annotations: {}

persistence:
type: emptyDir # or hostPath or PersistentVolumeClaim

#storageClass: ""
volumeSize: 10Gi

hostPath: ""

0 comments on commit 6cc4472

Please sign in to comment.