apiVersion: apps/v1
kind: Deployment
metadata:
  name: fastapi
  namespace: fastapi
  labels:
    app: fastapi
spec:
  replicas: 1
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 2
      maxUnavailable: 0
  selector:
    matchLabels:
      app: fastapi
  template:
    metadata:
      labels:
        app: fastapi
    spec:

      containers:
        - image: image_name
          imagePullPolicy: Always
          name: fastapi

          livenessProbe:
            httpGet:
              path: /
              port: 8000
            initialDelaySeconds: 10
            periodSeconds: 10
            failureThreshold: 12
          readinessProbe:
            httpGet:
              path: /
              port: 8000
            initialDelaySeconds: 10
            periodSeconds: 10
            failureThreshold: 12

      tolerations:
      - key: node.kubernetes.io/not-ready
        effect: NoExecute
        tolerationSeconds: 0
      - key: node.kubernetes.io/unreachable
        effect: NoExecute
        tolerationSeconds: 0
