132 lines
3.6 KiB
YAML
132 lines
3.6 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: recipe-book
|
|
labels:
|
|
app.kubernetes.io/name: recipe-book
|
|
spec:
|
|
# The public viewer and internal editor deliberately share one local SQLite
|
|
# volume, so they run as sidecars in one pod.
|
|
replicas: 1
|
|
revisionHistoryLimit: 5
|
|
progressDeadlineSeconds: 180
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: recipe-book
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: recipe-book
|
|
spec:
|
|
securityContext:
|
|
fsGroup: 1000
|
|
imagePullSecrets:
|
|
- name: gitea-registry
|
|
initContainers:
|
|
- name: initialize-database
|
|
image: git.uuard.com/nicholas/formulation
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- /bin/sh
|
|
- -ec
|
|
- |
|
|
if [ ! -s /data/recipe-book.sqlite ]; then
|
|
cp /app/seed/recipe-book.sqlite /data/recipe-book.sqlite
|
|
fi
|
|
volumeMounts:
|
|
- name: database
|
|
mountPath: /data
|
|
containers:
|
|
- name: recipe-book
|
|
image: git.uuard.com/nicholas/formulation
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- name: http
|
|
containerPort: 8080
|
|
protocol: TCP
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /app/
|
|
port: http
|
|
initialDelaySeconds: 2
|
|
periodSeconds: 5
|
|
timeoutSeconds: 2
|
|
failureThreshold: 6
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /app/
|
|
port: http
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
timeoutSeconds: 2
|
|
failureThreshold: 3
|
|
resources:
|
|
requests:
|
|
cpu: 10m
|
|
memory: 64Mi
|
|
limits:
|
|
cpu: 100m
|
|
memory: 256Mi
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
volumeMounts:
|
|
- name: database
|
|
mountPath: /app/var
|
|
readOnly: true
|
|
- name: recipe-book-admin
|
|
image: git.uuard.com/nicholas/formulation
|
|
imagePullPolicy: IfNotPresent
|
|
env:
|
|
- name: FORMULATION_READ_ONLY
|
|
value: "false"
|
|
- name: HOST
|
|
value: 0.0.0.0
|
|
- name: PORT
|
|
value: "8081"
|
|
ports:
|
|
- name: admin-http
|
|
containerPort: 8081
|
|
protocol: TCP
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /app/
|
|
port: admin-http
|
|
initialDelaySeconds: 2
|
|
periodSeconds: 5
|
|
timeoutSeconds: 2
|
|
failureThreshold: 6
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /app/
|
|
port: admin-http
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
timeoutSeconds: 2
|
|
failureThreshold: 3
|
|
resources:
|
|
requests:
|
|
cpu: 10m
|
|
memory: 64Mi
|
|
limits:
|
|
cpu: 200m
|
|
memory: 384Mi
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
volumeMounts:
|
|
- name: database
|
|
mountPath: /app/var
|
|
- name: generated
|
|
mountPath: /app/generated
|
|
volumes:
|
|
- name: database
|
|
persistentVolumeClaim:
|
|
claimName: recipe-book-database
|
|
- name: generated
|
|
emptyDir: {}
|