apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    description: HftApi
  labels:
    app: hftapi-worker
    environment: Development
    tier: Service
  name: hftapi-worker
  namespace: lykke
spec:
  revisionHistoryLimit: 1
  minReadySeconds: 10
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
  replicas: 1
  selector:
    matchLabels:
      app: hftapi-worker
  template:
    metadata:
      labels:
        app: hftapi-worker
      name: hftapi-worker
    spec:
      containers:
      - name: hftapi-worker
        image: docker.io/swisschains/lykke-hftapi-worker:latest
        imagePullPolicy: Always
        lifecycle:
          postStart:
            exec:
             command:
             - /bin/sh
             - -c 
             - "/bin/echo 'options single-request-reopen' >> /etc/resolv.conf"
        ports:
        - containerPort: 5000
        readinessProbe:
          httpGet:
            path: /api/isalive
            port: 5000
          initialDelaySeconds: 40
          periodSeconds: 10
        livenessProbe:
          httpGet:
            path: /api/isalive
            port: 5000
          initialDelaySeconds: 40
          periodSeconds: 20
        resources:
          requests:
            memory: 64Mi 
            cpu: 40m 
          limits:
            memory: 128Mi 
            cpu: 500m 
        env:
        - name: RemoteSettingsUrls__0 
          value: "http://settings.common.svc.cluster.local/common"
        - name: RemoteSettingsUrls__1 
          value: "http://settings.common.svc.cluster.local/lykke/common"
        - name: RemoteSettingsUrls__2
          value: "http://settings.common.svc.cluster.local/lykke/hftapi"