apps/linkwarden/resources/deployment.yaml

134 lines
3.7 KiB
YAML
Raw Normal View History

2023-12-21 13:56:26 +00:00
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: linkwarden
labels:
app.kubernetes.io/name: linkwarden
spec:
selector:
matchLabels:
app.kubernetes.io/name: linkwarden
replicas: 1
template:
metadata:
labels:
app.kubernetes.io/name: linkwarden
spec:
initContainers:
- name: install-packages
image: linkwarden
command: ["/bin/bash", "-c", "npx playwright install"]
volumeMounts:
- name: node-cache
mountPath: /home/node/.cache
2024-05-07 16:39:14 +00:00
- name: run-prisma-migrations
image: linkwarden
command: ["/data/node_modules/.bin/prisma"]
args: ["migrate", "deploy"]
2024-05-07 16:42:58 +00:00
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: default-cluster-pguser-linkwarden
key: uri
2023-12-21 13:56:26 +00:00
containers:
- name: linkwarden
image: linkwarden
2024-05-07 16:39:14 +00:00
command: ["/data/node_modules/.bin/next"]
args: ["start"]
2023-12-21 13:56:26 +00:00
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: default-cluster-pguser-linkwarden
key: uri
envFrom:
- secretRef:
name: linkwarden-config
ports:
- containerPort: 3000
protocol: TCP
name: web
volumeMounts:
- name: next-cache
mountPath: /data/.next/cache
- name: node-cache
mountPath: /home/node/.cache
resources:
requests:
memory: "384Mi"
cpu: "50m"
limits:
memory: "1500Mi"
2023-12-21 13:56:26 +00:00
cpu: "500m"
readinessProbe:
httpGet:
path: /login
port: 3000
initialDelaySeconds: 15
periodSeconds: 10
livenessProbe:
httpGet:
path: /login
port: 3000
initialDelaySeconds: 30
periodSeconds: 10
2023-12-21 13:56:26 +00:00
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
2024-05-07 16:39:14 +00:00
- name: linkwarden-worker
image: linkwarden
command: ["/data/node_modules/.bin/ts-node"]
args: ["--transpile-only", "--skip-project", "scripts/worker.ts"]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: default-cluster-pguser-linkwarden
key: uri
envFrom:
- secretRef:
name: linkwarden-config
volumeMounts:
- name: next-cache
mountPath: /data/.next/cache
- name: node-cache
mountPath: /home/node/.cache
resources:
requests:
memory: "384Mi"
cpu: "50m"
limits:
memory: "1500Mi"
cpu: "500m"
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
2023-12-21 13:56:26 +00:00
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- arm64
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
runAsNonRoot: true
volumes:
- name: next-cache
emptyDir:
sizeLimit: 250Mi
- name: node-cache
emptyDir:
sizeLimit: 1500Mi