Skip to content

Commit

Permalink
[Feat] Added support for modifying PVC through values.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: hanchenli <[email protected]>
  • Loading branch information
Hanchenli committed Feb 16, 2025
1 parent 93ad1cd commit f05391f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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.0.5
version: 0.0.6

maintainers:
- name: apostac
22 changes: 19 additions & 3 deletions helm/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,32 @@ kind: PersistentVolumeClaim
metadata:
name: "{{ .Release.Name }}-{{$modelSpec.name}}-storage-claim"
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/managed-by: Helm
annotations:
meta.helm.sh/release-name: "{{ .Release.Name }}"
meta.helm.sh/release-namespace: "{{ .Release.Namespace }}"
{{- if $modelSpec.pvcAnnotations }}
{{- toYaml $modelSpec.pvcAnnotations | nindent 4 }}
{{- end }}
spec:
accessModes: {{ toYaml $modelSpec.pvcAccessMode | nindent 4 }}
accessModes:
{{- if $modelSpec.pvcAccessMode }}
{{- toYaml $modelSpec.pvcAccessMode | nindent 4 }}
{{- else }}
- ReadWriteOnce # Default to EBS-compatible mode if not specified
{{- end }}
resources:
requests:
storage: {{ $modelSpec.pvcStorage }}
storage: {{ $modelSpec.pvcStorage | default "10Gi" }} # Default to 10Gi if not set
{{- if $modelSpec.storageClass }}
storageClassName: "{{ $modelSpec.storageClass }}" # Allow user-defined storageClass
{{- end }}
{{- if not (empty $modelSpec.pvcMatchLabels) }}
selector:
matchLabels:
{{- toYaml $modelSpec.pvcMatchLabels | nindent 8 }}
{{- end }}
{{- end }}
---
{{- end }}
{{- end }}

0 comments on commit f05391f

Please sign in to comment.