provisioning-catalog/components/lemmy/cluster/templates/pictrs-deployment.yaml.j2

74 lines
2 KiB
Django/Jinja

apiVersion: apps/v1
kind: Deployment
metadata:
name: lemmy-pictrs
namespace: {{ taskserv.namespace }}
labels:
app.kubernetes.io/name: lemmy-pictrs
app.kubernetes.io/managed-by: provisioning
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: lemmy-pictrs
template:
metadata:
labels:
app.kubernetes.io/name: lemmy-pictrs
app.kubernetes.io/managed-by: provisioning
spec:
securityContext:
fsGroup: 991
initContainers:
- name: fix-perms
image: busybox:1.36
command: ["sh", "-c", "chown -R 991:991 /mnt && chmod -R 750 /mnt"]
securityContext:
runAsUser: 0
volumeMounts:
- name: data
mountPath: /mnt
containers:
- name: pictrs
image: {{ taskserv.pictrs_image }}:{{ taskserv.pictrs_image_tag }}
ports:
- name: http
containerPort: 8080
protocol: TCP
env:
- name: PICTRS__SERVER__API_KEY
valueFrom:
secretKeyRef:
name: {{ taskserv.name }}-credentials
key: PICTRS_API_KEY
volumeMounts:
- name: data
mountPath: /mnt
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 6
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 3
resources:
requests:
cpu: "100m"
memory: "256Mi"
limits:
cpu: "500m"
memory: "1Gi"
terminationGracePeriodSeconds: 30
volumes:
- name: data
persistentVolumeClaim:
claimName: lemmy-pictrs-data