- db.rs: fix fresh-PVC startup crash by using SqliteConnectOptions with create_if_missing(true) and foreign_keys(true); drops after_connect - Dockerfile: switch to Node 22 + pnpm (corepack), run pnpm check before build, copy backend/demo/ for TT_TEST_MODE support, non-root app user, add HEALTHCHECK, remove baked-in JWT_SECRET - .dockerignore: exclude node_modules, build artifacts, data/, logs - deploy/: new Helm chart replacing k8s/ — Deployment, Service, HTTPRoute (Gateway API), PVC (hcloud-volumes), CronJob backup, ServiceAccount, VPA; JWT_SECRET sourced from pre-provisioned K8s Secret - k8s/: removed (superseded by deploy/) - ci.yml: replaces test.yml — Node 20->22, same test steps, adds no-push Docker build; triggers on non-main pushes and PRs - release.yml: new tag-driven workflow (v*.*.*) — runs tests, pushes image to registry.itsh.dev/s0wlz/tutortool, deploys via helm upgrade https://claude.ai/code/session_01N1kWaQJkz1fC7mUippdQR5
61 lines
1.9 KiB
YAML
61 lines
1.9 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "tutortool.fullname" . }}
|
|
namespace: {{ .Release.Namespace }}
|
|
labels:
|
|
{{- include "tutortool.labels" . | nindent 4 }}
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "tutortool.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "tutortool.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
serviceAccountName: {{ include "tutortool.serviceAccountName" . }}
|
|
securityContext:
|
|
fsGroup: 1000
|
|
containers:
|
|
- name: app
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
ports:
|
|
- containerPort: {{ .Values.containerPort }}
|
|
env:
|
|
- name: DATABASE_URL
|
|
value: {{ .Values.env.DATABASE_URL | quote }}
|
|
- name: STATIC_DIR
|
|
value: {{ .Values.env.STATIC_DIR | quote }}
|
|
- name: JWT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Values.jwtSecretName }}
|
|
key: JWT_SECRET
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /data
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: {{ .Values.containerPort }}
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 30
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: {{ .Values.containerPort }}
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
securityContext:
|
|
readOnlyRootFilesystem: false
|
|
allowPrivilegeEscalation: false
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
volumes:
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "tutortool.fullname" . }}-data
|