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