apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    description: indexer-worker-1
  labels:
    app: indexer-worker-1
    environment: Development
    tier: Service
  name: indexer-worker-1
  namespace: sirius-indexers
spec:
  revisionHistoryLimit: 1
  minReadySeconds: 10
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
  replicas: 1
  selector:
    matchLabels:
      app: indexer-worker-1
  template:
    metadata:
      labels:
        app: indexer-worker-1
      name: indexer-worker-1
    spec:
      containers:
      - name: indexer-worker-1
        image: docker.io/swisschains/sirius-indexer-worker:1.3.1
        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: 60
          periodSeconds: 10
        livenessProbe:
          httpGet:
            path: /api/isalive
            port: 5000
          initialDelaySeconds: 60
          periodSeconds: 20
        resources:
          requests:
            memory: 256Mi 
            cpu: 500m 
          limits:
            memory: 2048Mi 
            cpu: 2000m
        env:
        - name: RemoteSettingsRequired
          value: "true"
        - name: RemoteSettingsUrls__0 
          value: "http://settings.sirius.svc.cluster.local/common"
        - name: RemoteSettingsUrls__1
          value: "http://settings.sirius.svc.cluster.local/sirius/common"
        - name: RemoteSettingsUrls__2
          value: "http://settings.sirius.svc.cluster.local/sirius-indexers/common"
        - name: RemoteSettingsUrls__3
          value: "http://settings.sirius.svc.cluster.local/sirius-indexers/indexer-1-ENVIRONMENT_MODE"
      tolerations:
       - effect: NoSchedule
         operator: Exists
      nodeSelector:
        agentpool: sirindexers
