apiVersion: apps/v1
kind: Deployment
metadata:
  name: template-repository
  namespace: oih-dev-ns
  labels:
    app: template-repository
spec:
  replicas: 1
  selector:
    matchLabels:
      app: template-repository
  template:
    metadata:
      labels:
        app: template-repository
    spec:
      containers:
      - name: template-repository
        image: openintegrationhub/template-repository:latest
        imagePullPolicy: Always
        ports:
          - containerPort: 3001
        envFrom:
        - configMapRef:
            name: template-repository
        env:
          - name: MONGODB_URL
            valueFrom:
              secretKeyRef:
                name: template-repository
                key: 'mongourl'
          - name: IAM_TOKEN
            valueFrom:
              secretKeyRef:
                name: template-repository
                key: 'iamtoken'
        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
