stackage-server/etc/kube/deployment_template.yaml
2018-10-02 18:44:14 +02:00

66 lines
1.7 KiB
YAML

# Kubernetes
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: "${DEPLOYMENT_NAME}"
spec:
replicas: 2
minReadySeconds: 5
template:
metadata:
labels:
app: "${DEPLOYMENT_APP}"
spec:
containers:
- name: stackage-server
image: "${DEPLOYMENT_IMAGE}"
imagePullPolicy: Always
ports:
- name: http
containerPort: 3000
command: ["stackage-server"]
workingDir: /app
env:
- name: APPROOT
value: "${APPROOT}"
- name: PGSTRING
valueFrom:
secretKeyRef:
name: "${DEPLOYMENT_NAME}"
key: PGCONN
readinessProbe:
httpGet:
path: /
port: 3000
httpHeaders:
# Works around stackage-server's `forceSSL` redirect
- name: HTTPS
value: "on"
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 5
successThreshold: 1
livenessProbe:
httpGet:
path: /
port: 3000
httpHeaders:
# Works around stackage-server's `forceSSL` redirect
- name: HTTPS
value: "on"
initialDelaySeconds: 120
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
resources:
requests:
cpu: 100m
memory: 1.0Gi
limits:
cpu: 150m
memory: 1.5Gi
imagePullSecrets:
- name: registry-key