apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-directory
  namespace: oih-dev-ns
  labels:
    app: app-directory
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
        envFrom:
        - configMapRef:
            name: app-directory
        env:
        - name: IAM_TOKEN
          valueFrom:
            secretKeyRef:
              name: app-directory
              key: iamtoken
        - name: MONGODB_CONNECTION
          valueFrom:
            secretKeyRef:
              name: app-directory
              key: mongourl
        livenessProbe:
          httpGet:
            port: 3000
            path: /healthcheck
          initialDelaySeconds: 120
          timeoutSeconds: 1
        readinessProbe:
          httpGet:
            port: 3000
            path: /healthcheck
          initialDelaySeconds: 10
          timeoutSeconds: 1
  minReadySeconds: 10
  revisionHistoryLimit: 2
