apiVersion: v1
kind: Pod
metadata:
    name: flaskapp
    labels:
        app: flaskapp
spec:
    containers:
        - image: maxmax89/webapp:v2
          name: flaskapp
          ports:
              - name: liveness-port
                containerPort: 5000
                hostPort: 5000
          command: ["/bin/bash"]
          args: ["-c", "echo hello; sleep 10; gunicorn --bind 0.0.0.0:5000 server:app & echo runs; sleep 10; kill %1 && echo killed; sleep 600;"]
              
          livenessProbe:
            httpGet:
              path: /
              port: liveness-port
            failureThreshold: 1
            periodSeconds: 10
            
          readinessProbe:
            httpGet:
              path: /
              port: liveness-port
            initialDelaySeconds: 5
            periodSeconds: 5

          startupProbe:
            httpGet:
              path: /
              port: liveness-port
            failureThreshold: 5
            periodSeconds: 5