apiVersion: apps/v1
kind: Deployment
metadata:
  name: morphling-algorithm-server
  namespace: morphling-system
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      deployment: morphling-algorithm-server
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "false"
      labels:
        deployment: morphling-algorithm-server
    spec:
      containers:
        - image: kubedl/morphling-algorithm:base
          imagePullPolicy: Always #IfNotPresent
#          command: [ "/bin/sh" ]
#          args: ["-c", "sleep 100000"]

          livenessProbe:
            exec:
              command:
                - /bin/grpc_health_probe
                - -addr=:9996
                - -service=algorithm.probe
            failureThreshold: 12
            initialDelaySeconds: 10
            periodSeconds: 120
            successThreshold: 1
            timeoutSeconds: 1
          name: sampling-client
          ports:
            - containerPort: 9996
              name: morphling-api
              protocol: TCP
          readinessProbe:
            exec:
              command:
                - /bin/grpc_health_probe
                - -addr=:9996
                - -service=algorithm.probe
            failureThreshold: 3
            initialDelaySeconds: 10
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 1
          resources:
            limits:
              cpu: 500m
              ephemeral-storage: 5Gi
              memory: 100Mi
            requests:
              cpu: 50m
              ephemeral-storage: 500Mi
              memory: 10Mi
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
