81 lines
2.4 KiB
Text
81 lines
2.4 KiB
Text
|
|
apiVersion: apps/v1
|
||
|
|
kind: Deployment
|
||
|
|
metadata:
|
||
|
|
name: {{ taskserv.name }}-hub
|
||
|
|
namespace: {{ taskserv.namespace }}
|
||
|
|
labels:
|
||
|
|
app.kubernetes.io/name: {{ taskserv.name }}-hub
|
||
|
|
app.kubernetes.io/managed-by: provisioning
|
||
|
|
spec:
|
||
|
|
replicas: 1
|
||
|
|
strategy:
|
||
|
|
type: Recreate
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app.kubernetes.io/name: {{ taskserv.name }}-hub
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app.kubernetes.io/name: {{ taskserv.name }}-hub
|
||
|
|
app.kubernetes.io/managed-by: provisioning
|
||
|
|
spec:
|
||
|
|
initContainers:
|
||
|
|
- name: hub-migrate
|
||
|
|
image: ghcr.io/formbricks/hub:latest
|
||
|
|
command: ["/bin/sh", "-c"]
|
||
|
|
args:
|
||
|
|
- |
|
||
|
|
if [ -x /usr/local/bin/goose ] && [ -x /usr/local/bin/river ]; then
|
||
|
|
/usr/local/bin/goose -dir /app/migrations postgres "$DATABASE_URL" up &&
|
||
|
|
/usr/local/bin/river migrate-up --database-url "$DATABASE_URL"
|
||
|
|
else
|
||
|
|
echo "Migration tools (goose/river) not in image."
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
env:
|
||
|
|
- name: DATABASE_URL
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: {{ taskserv.name }}-credentials
|
||
|
|
key: DATABASE_URL
|
||
|
|
containers:
|
||
|
|
- name: hub
|
||
|
|
image: ghcr.io/formbricks/hub:latest
|
||
|
|
ports:
|
||
|
|
- name: http
|
||
|
|
containerPort: 8080
|
||
|
|
protocol: TCP
|
||
|
|
env:
|
||
|
|
- name: API_KEY
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: {{ taskserv.name }}-credentials
|
||
|
|
key: HUB_API_KEY
|
||
|
|
- name: DATABASE_URL
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: {{ taskserv.name }}-credentials
|
||
|
|
key: DATABASE_URL
|
||
|
|
readinessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /health
|
||
|
|
port: 8080
|
||
|
|
initialDelaySeconds: 10
|
||
|
|
periodSeconds: 10
|
||
|
|
failureThreshold: 6
|
||
|
|
livenessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /health
|
||
|
|
port: 8080
|
||
|
|
initialDelaySeconds: 30
|
||
|
|
periodSeconds: 30
|
||
|
|
failureThreshold: 3
|
||
|
|
resources:
|
||
|
|
requests:
|
||
|
|
cpu: "50m"
|
||
|
|
memory: "128Mi"
|
||
|
|
limits:
|
||
|
|
cpu: "500m"
|
||
|
|
memory: "512Mi"
|
||
|
|
terminationGracePeriodSeconds: 30
|