feat: support persistent volume
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Add persistent volume for sqlite3 backend
This commit is contained in:
parent
cb03476ed7
commit
ce624330c1
@ -97,8 +97,7 @@ be the options passed via the `--set` flag of the `helm install` command.
|
|||||||
|
|
||||||
## Missing features
|
## Missing features
|
||||||
|
|
||||||
1. Add Persistent Volume for the SQLite database
|
1. Support postgres, maria and mysql database directly as helm dependency if as
|
||||||
2. Support postgres, maria and mysql database directly as helm dependency if as
|
|
||||||
`DATABASE_DRIVER` an other instead of `sqlite` has been selected.
|
`DATABASE_DRIVER` an other instead of `sqlite` has been selected.
|
||||||
Alternatively can be passed a completely custom string to establish a
|
Alternatively can be passed a completely custom string to establish a
|
||||||
database connection, when the database is running outside the cluster.
|
database connection, when the database is running outside the cluster.
|
||||||
|
@ -38,7 +38,24 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
{{- if eq (default "sqlite3" .Values.config.DRONE_DATABASE_DRIVER) "sqlite3" }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: {{ default "/data/database.sqlite" .Values.config.DRONE_DATABASE_DATASOURCE | dir }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if and (eq (default "sqlite3" .Values.config.DRONE_DATABASE_DRIVER) "sqlite3") .Values.persistence.existingClaim }}
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
{{- with .Values.persistence.existingClaim }}
|
||||||
|
claimName: {{ tpl . $ }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else if and (.Values.config.DRONE_DATABASE_DRIVER | default "sqlite3" | eq "sqlite3") (not .Values.persistence.existingClaim) }}
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: drone
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
|
17
templates/persistentVolumeClaim.yaml
Normal file
17
templates/persistentVolumeClaim.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{{ if and (eq (default "sqlite3" .Values.config.DRONE_DATABASE_DRIVER) "sqlite3") (not .Values.persistence.existingClaim) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: drone
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
{{- range .Values.persistence.accessModes }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.size | quote }}
|
||||||
|
{{- if .Values.persistence.storageClass }}
|
||||||
|
storageClassName: {{ .Values.persistence.storageClass | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
15
values.yaml
15
values.yaml
@ -27,7 +27,7 @@ securityContext: {}
|
|||||||
# runAsNonRoot: true
|
# runAsNonRoot: true
|
||||||
# runAsUser: 1000
|
# runAsUser: 1000
|
||||||
|
|
||||||
config:
|
config: {}
|
||||||
# DRONE_BITBUCKET_CLIENT_ID
|
# DRONE_BITBUCKET_CLIENT_ID
|
||||||
# String value. Configures the Bitbucket OAuth client id. This is used to
|
# String value. Configures the Bitbucket OAuth client id. This is used to
|
||||||
# authorize access to Bitbucket on behalf of a Drone user.
|
# authorize access to Bitbucket on behalf of a Drone user.
|
||||||
@ -506,4 +506,15 @@ nodeSelector: {}
|
|||||||
|
|
||||||
tolerations: []
|
tolerations: []
|
||||||
|
|
||||||
affinity: {}
|
affinity: {}
|
||||||
|
|
||||||
|
# persistence is only required when config.DATABASE_DRIVER is not sqlite3 or
|
||||||
|
# undefined.
|
||||||
|
persistence:
|
||||||
|
# existingClaim:
|
||||||
|
size: 5Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
labels: {}
|
||||||
|
annotation: {}
|
||||||
|
# storageClass:
|
Loading…
Reference in New Issue
Block a user