---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: thefractalspace
spec:
  replicas: 1
  selector:
    matchLabels:
      component: website
  strategy:
    rollingUpdate:
      maxSurge: 50%
      maxUnavailable: 50%
  template:
    metadata:
      labels:
        component: website
    spec:
      containers:
        - name: thefractalspace
          image: thefractal.space
          ports:
            - name: http
              containerPort: 8000
              protocol: TCP
          startupProbe:
            httpGet:
              path: /healthz
              port: http
          readinessProbe:
            httpGet:
              path: /healthz
              port: http
          livenessProbe:
            httpGet:
              path: /healthz
              port: http
          lifecycle:
            preStop:
              exec:
                command: ["/bin/sh", "-c", "sleep 5"]
          env:
            - name: FRACTALS_DIR
              value: /data
          volumeMounts:
            - name: datadir
              mountPath: /data
      volumes:
        - name: datadir
          persistentVolumeClaim:
            claimName: thefractalspace-datadir
