From 96ff909a0a4bc03da560c86ae8a973e3f66cc4c3 Mon Sep 17 00:00:00 2001 From: Roger Oriol Date: Fri, 30 Jan 2026 23:57:07 +0100 Subject: [PATCH] gym-tracker deployment --- .gitignore | 3 +- gym-tracker/deployment.yaml | 96 +++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 gym-tracker/deployment.yaml diff --git a/.gitignore b/.gitignore index eabeb01..e5a1a79 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -**/*secret* -gym-tracker/ +**/*secret* \ No newline at end of file diff --git a/gym-tracker/deployment.yaml b/gym-tracker/deployment.yaml new file mode 100644 index 0000000..6d2a614 --- /dev/null +++ b/gym-tracker/deployment.yaml @@ -0,0 +1,96 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gym-tracker + labels: + app: gym-tracker +spec: + replicas: 1 # Single replica since using SQLite + selector: + matchLabels: + app: gym-tracker + template: + metadata: + labels: + app: gym-tracker + spec: + containers: + - name: gym-tracker + image: gym-tracker:latest + imagePullPolicy: Never + ports: + - containerPort: 80 + name: http + protocol: TCP + - containerPort: 3000 + name: backend + protocol: TCP + env: + - name: NODE_ENV + value: "production" + - name: PORT + value: "3000" + volumeMounts: + - name: data + mountPath: /app/data + livenessProbe: + httpGet: + path: /health + port: 80 + initialDelaySeconds: 10 + periodSeconds: 30 + timeoutSeconds: 3 + failureThreshold: 3 + readinessProbe: + httpGet: + path: /health + port: 80 + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 3 + failureThreshold: 3 + resources: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "512Mi" + cpu: "500m" + volumes: + - name: data + persistentVolumeClaim: + claimName: gym-tracker-data +--- +apiVersion: v1 +kind: Service +metadata: + name: gym-tracker + labels: + app: gym-tracker +spec: + type: ClusterIP + selector: + app: gym-tracker + ports: + - name: http + port: 80 + targetPort: 80 + protocol: TCP + - name: backend + port: 3000 + targetPort: 3000 + protocol: TCP +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: gym-tracker-data + labels: + app: gym-tracker +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + storageClassName: local-path \ No newline at end of file