apiVersion: apps/v1
kind: Deployment
metadata:
  name: dispatcher-service
  namespace: oih-dev-ns
spec:
  replicas: 1
  selector:
    matchLabels:
      app: dispatcher-service
  template:
    metadata:
      labels:
        app: dispatcher-service
    spec:
      containers:
        - name: dispatcher-service
          image: openintegrationhub/dispatcher-service:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 3013
          env:
            - name: MONGODB_URL
              valueFrom:
                secretKeyRef:
                  name: shared-secret
                  key: 'dispatcherMongoUrl'
            - name: IAM_TOKEN
              valueFrom:
                secretKeyRef:
                  name: shared-secret
                  key: 'iamtoken'
            - name: "INTROSPECT_TYPE"
              value: "basic"
            - name: "INTROSPECT_ENDPOINT_BASIC"
              value: "http://iam.oih-dev-ns.svc.cluster.local:3099/api/v1/tokens/introspect"
            - name: "QUEUE_URL"
              value: "amqp://guest:guest@rabbitmq-service.oih-dev-ns.svc.cluster.local:5672"
            - name: "FLOWREPO_URL"
              value: "http://flow-repository.oih-dev-ns.svc.cluster.local:3001"
            - name: FLOW_TOKEN
              valueFrom:
                secretKeyRef:
                  name: shared-secret
                  key: 'iamtoken'
            - name: "SDF_ID"
              value: "ReplaceMe"
          resources:
            limits:
              cpu: '0.1'
              memory: 1000Mi
          livenessProbe:
            httpGet:
              path: /healthcheck
              port: 3013
            initialDelaySeconds: 120
            timeoutSeconds: 1
          readinessProbe:
            httpGet:
              path: /healthcheck
              port: 3013
            initialDelaySeconds: 10
            timeoutSeconds: 1
