feat: Add persistence configuration to Helm chart for card image caching and update image repository and tag.
All checks were successful
Build and Deploy / build (push) Successful in 1m19s

This commit is contained in:
2025-12-14 23:07:36 +01:00
parent 53553aae0a
commit 6dc69dd22a
4 changed files with 45 additions and 3 deletions

View File

@@ -20,8 +20,9 @@
- `GameManager.ts`: Renamed unused args in `shuffleLibrary`. - `GameManager.ts`: Renamed unused args in `shuffleLibrary`.
- **Helm Chart**: Created a complete Helm chart configuration in `helm/mtg-draft-maker`: - **Helm Chart**: Created a complete Helm chart configuration in `helm/mtg-draft-maker`:
- `Chart.yaml`: Defined chart metadata. - `Chart.yaml`: Defined chart metadata.
- `values.yaml`: Configured defaults (Image `mtg-draft-maker:latest`, Port 3000). - `values.yaml`: Configured defaults (Image `git.commandware.com/services/mtg-online-drafter:main`, Port 3000).
- `templates/`: Added Deployment, Service, Ingress, and ServiceAccount manifests. - `templates/`: Added Deployment, Service, Ingress, and ServiceAccount manifests.
- **Persistence**: Added configuration to mount a Persistent Volume Claim (PVC) at `/app/server/public/cards` for storing cached images. Disabled by default.
- Linted successfully. - Linted successfully.
## Status ## Status

View File

@@ -45,6 +45,11 @@ spec:
httpGet: httpGet:
path: /api/health path: /api/health
port: http port: http
volumeMounts:
{{- if .Values.persistence.enabled }}
- name: cards-storage
mountPath: {{ .Values.persistence.mountPath }}
{{- end }}
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
@@ -59,3 +64,9 @@ spec:
tolerations: tolerations:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
volumes:
{{- if .Values.persistence.enabled }}
- name: cards-storage
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "mtg-draft-maker.fullname" .) }}
{{- end }}

View File

@@ -0,0 +1,21 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "mtg-draft-maker.fullname" . }}
labels:
{{- include "mtg-draft-maker.labels" . | nindent 4 }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end }}

View File

@@ -5,10 +5,10 @@
replicaCount: 1 replicaCount: 1
image: image:
repository: mtg-draft-maker repository: git.commandware.com/services/mtg-online-drafter
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion. # Overrides the image tag whose default is the chart appVersion.
tag: "latest" tag: "main"
imagePullSecrets: [] imagePullSecrets: []
nameOverride: "" nameOverride: ""
@@ -75,6 +75,15 @@ autoscaling:
targetCPUUtilizationPercentage: 80 targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80
persistence:
enabled: false
storageClass: "-"
accessMode: ReadWriteOnce
size: 1Gi
mountPath: /app/server/public/cards
## If you want to use an existing claim, set this:
# existingClaim: my-claim
nodeSelector: {} nodeSelector: {}
tolerations: [] tolerations: []