apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-directory
  namespace: oih-dev-ns
spec:
  replicas: 1
  selector:
    matchLabels:
      app: app-directory
  template:
    metadata:
      labels:
        app: app-directory
    spec:
      containers:
      - name: app-directory
        image: openintegrationhub/app-directory:latest
        ports:
        - containerPort: 3000
        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: example.com,http://web-ui.example.com,https://web-ui.example.com
        - name: PORT
          value: "3000"
        - name: API_BASE
          value: "/api/v1"
        - name: LOG_LEVEL
          value: "error"
        - name: DEBUG_MODE
          value: "false"
        - name: RABBITMQ_URI
          value: "amqp://guest:guest@rabbitmq-service.oih-dev-ns.svc.cluster.local:5672"
        livenessProbe:
          httpGet:
            port: 3000
            path: /healthcheck
          initialDelaySeconds: 120
          timeoutSeconds: 1
        readinessProbe:
          httpGet:
            port: 3000
            path: /healthcheck
          initialDelaySeconds: 10
          timeoutSeconds: 1
  minReadySeconds: 10
  revisionHistoryLimit: 2
