apiVersion: apps/v1
kind: Deployment
metadata:
  name: ils
  namespace: oih-dev-ns
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ils
  template:
    metadata:
      labels:
        app: ils
    spec:
      containers:
        - name: ils
          imagePullPolicy: IfNotPresent
          image: node:12-alpine
          workingDir: /usr/src/app/
          command: ["/bin/sh"]
          args: ["-c","yarn install --non-interactive && yarn start:container"]
          ports:
            - containerPort: 3003
          env:
            - name: MONGODB_URL
              valueFrom:
                secretKeyRef:
                  name: shared-secret
                  key: 'ilsMongourl'
            - name: NODE_ENV
              value: development
            - name: LOG_LEVEL
              value: info
          resources:
            limits:
              cpu: '0.1'
              memory: 200Mi
          volumeMounts:
            - name: code
              mountPath: /usr/src/app
              subPath: services/ils
          livenessProbe:
            httpGet:
              path: /healthcheck
              port: 3003
            initialDelaySeconds: 300
            timeoutSeconds: 1
          readinessProbe:
            httpGet:
              path: /healthcheck
              port: 3003
            initialDelaySeconds: 120
            timeoutSeconds: 1
      volumes:
        - name: code
          persistentVolumeClaim:
            claimName: source-volume-claim
