diff --git a/docs/development/devlog/2025-12-14-235700_docker_containerization.md b/docs/development/devlog/2025-12-14-235700_docker_containerization.md index e01a4ad..2f6afbb 100644 --- a/docs/development/devlog/2025-12-14-235700_docker_containerization.md +++ b/docs/development/devlog/2025-12-14-235700_docker_containerization.md @@ -20,8 +20,9 @@ - `GameManager.ts`: Renamed unused args in `shuffleLibrary`. - **Helm Chart**: Created a complete Helm chart configuration in `helm/mtg-draft-maker`: - `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. + - **Persistence**: Added configuration to mount a Persistent Volume Claim (PVC) at `/app/server/public/cards` for storing cached images. Disabled by default. - Linted successfully. ## Status diff --git a/helm/mtg-draft-maker/templates/deployment.yaml b/helm/mtg-draft-maker/templates/deployment.yaml index 5d831a8..43983ea 100644 --- a/helm/mtg-draft-maker/templates/deployment.yaml +++ b/helm/mtg-draft-maker/templates/deployment.yaml @@ -45,6 +45,11 @@ spec: httpGet: path: /api/health port: http + volumeMounts: + {{- if .Values.persistence.enabled }} + - name: cards-storage + mountPath: {{ .Values.persistence.mountPath }} + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} @@ -59,3 +64,9 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + volumes: + {{- if .Values.persistence.enabled }} + - name: cards-storage + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim | default (include "mtg-draft-maker.fullname" .) }} + {{- end }} diff --git a/helm/mtg-draft-maker/templates/pvc.yaml b/helm/mtg-draft-maker/templates/pvc.yaml new file mode 100644 index 0000000..c3cfe71 --- /dev/null +++ b/helm/mtg-draft-maker/templates/pvc.yaml @@ -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 }} diff --git a/helm/mtg-draft-maker/values.yaml b/helm/mtg-draft-maker/values.yaml index e35c43e..9c89386 100644 --- a/helm/mtg-draft-maker/values.yaml +++ b/helm/mtg-draft-maker/values.yaml @@ -5,10 +5,10 @@ replicaCount: 1 image: - repository: mtg-draft-maker + repository: git.commandware.com/services/mtg-online-drafter pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "latest" + tag: "main" imagePullSecrets: [] nameOverride: "" @@ -75,6 +75,15 @@ autoscaling: targetCPUUtilizationPercentage: 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: {} tolerations: []