Skip to content

Commit

Permalink
Merge pull request #109 from dasmeta/DMVP-4884-multiple-pvcs
Browse files Browse the repository at this point in the history
feat(DMVP-4884): Added feature to have multiple PVCs
  • Loading branch information
viktoryathegreat authored Aug 6, 2024
2 parents 86940c5 + 8ee68c5 commit 4e60ca5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 28 deletions.
4 changes: 2 additions & 2 deletions charts/base/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.1
version: 0.2.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.2.1"
appVersion: "0.2.2"
28 changes: 15 additions & 13 deletions charts/base/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
{{- if .Values.storage -}}
{{- $storageValues := (kindIs "slice" .Values.storage | ternary .Values.storage (list .Values.storage)) -}}
{{- range $storage := $storageValues }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.storage.persistentVolumeClaimName | default (include "base.fullname" .) }}
name: {{ $storage.persistentVolumeClaimName | default (include "base.fullname" $) }}
labels:
{{- include "base.labels" . | nindent 4 }}
{{- if .Values.storage.keepPvc }}
{{- include "base.labels" $ | nindent 4 }}
{{- if $storage.keepPvc }}
annotations:
"helm.sh/resource-policy": keep
"helm.sh/resource-policy": "keep"
{{- end }}
spec:
{{- with .Values.storage }}
accessModes:
{{- toYaml .accessModes | nindent 4 }}
volumeMode: {{ .volumeMode | default "Filesystem" }}
{{- toYaml $storage.accessModes | nindent 4 }}
volumeMode: {{ $storage.volumeMode | default "Filesystem" }}
resources:
requests:
storage: {{ .requestedSize }}
{{- if .className }}
storageClassName: {{ .className }}
storage: {{ $storage.requestedSize }}
{{- if $storage.className }}
storageClassName: {{ $storage.className }}
{{- end }}
{{- end }}
{{ if .Values.storage.enableDataSource}}
{{- if $storage.enableDataSource }}
dataSource:
kind: PersistentVolumeClaim
name: {{ .Values.storage.persistentVolumeClaimName | default (include "base.fullname" .) }}
name: {{ $storage.persistentVolumeClaimName | default (include "base.fullname" $) }}
{{- end }}
{{- end }}
{{- end }}
38 changes: 25 additions & 13 deletions charts/base/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
securityContext:
{}
# capabilities:
# drop:
# - ALL
Expand Down Expand Up @@ -91,7 +92,7 @@ ingress:

secrets: []
secretsDefaultEngine: "ExternalSecrets"
# secrets:
# secrets:
# - external-secret-1
# - external-secret-2
# - external-secret-3
Expand All @@ -114,7 +115,8 @@ secretsDefaultEngine: "ExternalSecrets"

extraContainer: {}

resources: {}
resources:
{}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
Expand Down Expand Up @@ -143,7 +145,8 @@ config: {}

containerPort: 80

livenessProbe: {}
livenessProbe:
{}
# failureThreshold: 3
# httpGet:
# path: /
Expand All @@ -154,7 +157,8 @@ livenessProbe: {}
# successThreshold: 1
# timeoutSeconds: 1

readinessProbe: {}
readinessProbe:
{}
# httpGet:
# path: /
# port: http
Expand All @@ -164,18 +168,26 @@ readinessProbe: {}
envFrom:
secret:

startupProbe: {}
startupProbe:
{}
# httpGet:
# path: /
# port: http

storage: {}
# persistentVolumeClaimName: pvc-docs
# requestedSize: 1G
# className: gp2
# accessModes:
# - ReadWriteOnce
# keepPvc: false
storage:
{}
# - persistentVolumeClaimName: "pvc-1"
# accessModes:
# - ReadWriteMany
# className: efs-sc
# requestedSize: 2Gi
# enableDataSource: false
# - persistentVolumeClaimName: pvc-2
# accessModes:
# - ReadWriteMany
# className: efs-sc-root
# requestedSize: "2Gi"
# enableDataSource: false

deployment: {}

Expand Down

0 comments on commit 4e60ca5

Please sign in to comment.