85 lines
2.5 KiB
YAML
85 lines
2.5 KiB
YAML
|
|
apiVersion: apps/v1
|
||
|
|
kind: Deployment
|
||
|
|
metadata:
|
||
|
|
name: osint-app
|
||
|
|
namespace: osint
|
||
|
|
labels:
|
||
|
|
app: osint-app
|
||
|
|
spec:
|
||
|
|
replicas: 1
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app: osint-app
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app: osint-app
|
||
|
|
spec:
|
||
|
|
tolerations:
|
||
|
|
- key: dedicated
|
||
|
|
operator: Exists
|
||
|
|
effect: PreferNoSchedule
|
||
|
|
nodeSelector:
|
||
|
|
kubernetes.io/hostname: siriussec
|
||
|
|
initContainers:
|
||
|
|
# Wait for Postgres before alembic runs (the entrypoint migrates).
|
||
|
|
- name: wait-for-db
|
||
|
|
image: forgejo.siriusdevops.com/sirius/osint-dashboard:amd64-c48788d4b614
|
||
|
|
imagePullPolicy: IfNotPresent
|
||
|
|
command:
|
||
|
|
- python
|
||
|
|
- -c
|
||
|
|
- |
|
||
|
|
import os, socket, sys, time
|
||
|
|
host, port = os.environ.get("DB_HOST", "osint-db"), int(os.environ.get("DB_PORT", "5432"))
|
||
|
|
deadline = time.time() + 300
|
||
|
|
while time.time() < deadline:
|
||
|
|
try:
|
||
|
|
with socket.create_connection((host, port), timeout=3):
|
||
|
|
print("postgres is reachable"); sys.exit(0)
|
||
|
|
except OSError:
|
||
|
|
time.sleep(3)
|
||
|
|
sys.exit("postgres did not become reachable in 300s")
|
||
|
|
containers:
|
||
|
|
- name: app
|
||
|
|
image: forgejo.siriusdevops.com/sirius/osint-dashboard:amd64-c48788d4b614
|
||
|
|
imagePullPolicy: IfNotPresent
|
||
|
|
ports:
|
||
|
|
- containerPort: 8000
|
||
|
|
name: http
|
||
|
|
envFrom:
|
||
|
|
- configMapRef:
|
||
|
|
name: osint-env
|
||
|
|
env:
|
||
|
|
- name: DB_PASSWORD
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: osint-db
|
||
|
|
key: password
|
||
|
|
readinessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /api/health
|
||
|
|
port: 8000
|
||
|
|
initialDelaySeconds: 10
|
||
|
|
periodSeconds: 15
|
||
|
|
failureThreshold: 6
|
||
|
|
livenessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /api/health
|
||
|
|
port: 8000
|
||
|
|
initialDelaySeconds: 90
|
||
|
|
periodSeconds: 30
|
||
|
|
failureThreshold: 5
|
||
|
|
volumeMounts:
|
||
|
|
- name: snapshots
|
||
|
|
mountPath: /data/snapshots
|
||
|
|
resources:
|
||
|
|
requests:
|
||
|
|
cpu: 100m
|
||
|
|
memory: 256Mi
|
||
|
|
limits:
|
||
|
|
memory: 1Gi
|
||
|
|
volumes:
|
||
|
|
- name: snapshots
|
||
|
|
persistentVolumeClaim:
|
||
|
|
claimName: osint-camera-snapshots
|