apiVersion: apps/v1
kind: Deployment
metadata:
  name: flow-repository
  namespace: oih-dev-ns
spec:
  replicas: 1
  selector:
    matchLabels:
      app: flow-repository
  template:
    metadata:
      labels:
        app: flow-repository
    spec:
      containers:
        - name: flow-repository
          image: openintegrationhub/flow-repository:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 3001
          env:
            - name: MONGODB_URL
              valueFrom:
                secretKeyRef:
                  name: flow-repository
                  key: 'mongourl'
            - name: IAM_TOKEN
              valueFrom:
                secretKeyRef:
                  name: flow-repository
                  key: 'iamtoken'
            - name: QUEUE_URL
              value: 'amqp://guest:guest@rabbitmq-service.oih-dev-ns.svc.cluster.local:5672'
            - name: ORIGINWHITELIST
              value: 'openintegrationhub.com,http://web-ui.openintegrationhub.com'
            - name: NODE_ENV
              value: 'production'
            - name: "INTROSPECT_TYPE"
              value: "basic"
            - name: "INTROSPECT_ENDPOINT_BASIC"
              value: "http://iam.openintegrationhub.com/api/v1/tokens/introspect"
          resources:
            limits:
              cpu: '0.1'
              memory: 500Mi
          livenessProbe:
            httpGet:
              path: /healthcheck
              port: 3001
            initialDelaySeconds: 120
            timeoutSeconds: 1
          readinessProbe:
            httpGet:
              path: /healthcheck
              port: 3001
            initialDelaySeconds: 10
            timeoutSeconds: 1
