Skip to content

Commit

Permalink
feat(helm): update chart version to 1.1.4 and add data volume support…
Browse files Browse the repository at this point in the history
… for persistent storage

feat(helm): create PersistentVolumeClaim templates for data and cache volumes to enhance storage management
  • Loading branch information
masterkain committed Dec 27, 2024
1 parent 716aa7c commit 54a2a78
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/nextjs/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: nextjs
description: Generic Helm chart for Nextjs apps on Kubernetes
type: application
version: 1.1.3
version: 1.1.4
appVersion: '1.0.0'
keywords:
- nextjs
Expand Down
11 changes: 11 additions & 0 deletions charts/nextjs/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ spec:
- name: next-cache
mountPath: {{ .Values.web.cachePersistentVolume.mountPath }}
{{- end }}
{{- if .Values.web.dataVolume.enabled }}
volumeMounts:
- name: next-data
mountPath: {{ .Values.web.dataVolume.mountPath }}
{{- end }}
{{- if .Values.web.extraContainers }}
{{- range .Values.web.extraContainers }}
- name: {{ .name | quote }}
Expand Down Expand Up @@ -120,3 +125,9 @@ spec:
persistentVolumeClaim:
claimName: {{ include "app.web.name" . }}-next-cache
{{- end }}
{{- if .Values.web.dataVolume.enabled }}
volumes:
- name: next-data
persistentVolumeClaim:
claimName: {{ include "app.web.name" . }}-next-data
{{- end }}
File renamed without changes.
20 changes: 20 additions & 0 deletions charts/nextjs/templates/web-pvc-data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.web.dataVolume.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "app.fullname" . }}-web-next-data
annotations:
{{- toYaml .Values.web.dataVolume.annotations | nindent 4 }}
labels:
{{- include "app.labels" . | nindent 4 }}
spec:
accessModes: {{ toYaml .Values.web.dataVolume.accessModes | nindent 4 }}
resources:
requests:
storage: {{ .Values.web.dataVolume.size }}
storageClassName: {{ .Values.web.dataVolume.storageClass }}
volumeMode: {{ .Values.web.dataVolume.volumeMode }}
{{- if .Values.web.dataVolume.existingClaim }}
volumeName: {{ .Values.web.dataVolume.existingClaim }}
{{- end }}
{{- end }}
11 changes: 11 additions & 0 deletions charts/nextjs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ web:
volumeMode: '' # The volume mode for the PVC. Can be either "Filesystem" (default) or "Block"
mountPath: /app/.next/cache # The path to mount the volume in the container

dataVolume:
enabled: false # If set to true, a PersistentVolumeClaim (PVC) will be created
storageClass: '' # The storage class to use for the PVC. If not set, the default StorageClass will be used
existingClaim: '' # If set, this existing PVC will be used instead of creating a new one
accessModes:
- ReadWriteOnce # The access modes for the PVC. Can be ReadWriteOnce, ReadOnlyMany, or ReadWriteMany. If dataVolume is enabled and replicaCount is more than 1, this should be set to ReadWriteMany
annotations: {} # Annotations to add to the PVC
size: 1Gi # The requested storage size for the PVC
volumeMode: '' # The volume mode for the PVC. Can be either "Filesystem" (default) or "Block"
mountPath: /app/data # The path to mount the volume in the container

hpa:
enabled: false
maxReplicas: 10
Expand Down

0 comments on commit 54a2a78

Please sign in to comment.