apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-directory
  namespace: oih-dev-ns
spec:
  replicas: 1
  selector:
    matchLabels:
      app: app-directory
  minReadySeconds: 10
  revisionHistoryLimit: 2
  template:
    metadata:
      labels:
        app: app-directory
    spec:
      containers:
        - name: app-directory
          image: openintegrationhub/app-directory:latest
          env:
            - name: IAM_TOKEN
              valueFrom:
                secretKeyRef:
                  name: shared-secret
                  key: 'iamtoken'
            - name: MONGODB_CONNECTION
              valueFrom:
                secretKeyRef:
                  name: shared-secret
                  key: 'appDirectoryMongourl'
            - name: "INTROSPECT_TYPE"
              value: "basic"
            - name: "INTROSPECT_ENDPOINT_BASIC"
              value: "http://iam.oih-dev-ns.svc.cluster.local:3099/api/v1/tokens/introspect"
            - name: ORIGIN_WHITELIST
              value: localoih.com,http://web-ui.localoih.com,https://web-ui.localoih.com
            - name: PORT
              value: '3000'
            - name: API_BASE
              value: "/api/v1"
            - name: LOGGING_LEVEL
              value: "error"
            - name: DEBUG_MODE
              value: "false"
            - name: RABBITMQ_URI
              value: "amqp://guest:guest@rabbitmq-service.oih-dev-ns.svc.cluster.local:5672"
          ports:
            - containerPort: 3000
          livenessProbe:
            httpGet:
              path: /healthcheck
              port: 3000
            initialDelaySeconds: 120
            timeoutSeconds: 1
          readinessProbe:
            httpGet:
              path: /healthcheck
              port: 3000
            initialDelaySeconds: 10
            timeoutSeconds: 1
