apiVersion: apps/v1
kind: Deployment
metadata:
  name: seyabot-deploy
  namespace: default
  labels:
    app: seyabot
    class: robot
spec:
  replicas: 1
  selector:
    matchLabels:
      app: seyabot
      class: robot
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 0
      maxUnavailable: 1
  template:
    metadata:
      labels:
        app: seyabot
        class: robot
        role: client
    spec:
      restartPolicy: Always
      hostNetwork: true
      containers:
      - name: seyabot
        image: ${IMAGE}
        imagePullPolicy: IfNotPresent
        env:
        - name: PYTHONUNBUFFERED
          value: "1"
        livenessProbe:
          exec:
            command: ["/bin/bash","-c","ps aux | grep [r]un.py"]
          failureThreshold: 3
          initialDelaySeconds: 5
          periodSeconds: 5
          timeoutSeconds: 5
        readinessProbe:
          exec:
            command: ["/bin/bash","-c","ps aux | grep [r]un.py"]
          failureThreshold: 3
          initialDelaySeconds: 5
          periodSeconds: 5
          timeoutSeconds: 5
        volumeMounts:
        - name: baseconf
          mountPath: /data/seyabot/conf/conf.json
        - name: logs
          mountPath: /data/seyabot/logs/
      volumes:
      - name: baseconf
        hostPath:
          type: File
          path: /data/kubernetes/data/robot/seyabot/conf/conf.json
      - name: logs
        hostPath:
          type: DirectoryOrCreate
          path: /data/kubernetes/data/robot/seyabot/logs/
      imagePullSecrets:
        - name: myalihub