apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-ui
  namespace: oih-dev-ns
spec:
  replicas: 1
  selector:
    matchLabels:
      app: web-ui
  template:
    metadata:
      labels:
        app: web-ui
    spec:
      containers:
      - name: web-ui
        image: node:12-alpine #openintegrationhub/iam:latest #
        command: ["/bin/sh"]
        args: ["-c", "yarn install --non-interactive && yarn start:container"]
        workingDir: /usr/src/app/
        ports:
        - containerPort: 3000
        env:
        - name: PORT
          value: "3000"
        - name: ENDPOINT_IAM
          value: "http://iam.localoih.com"
        - name: ENDPOINT_FLOW
          value: "http://flow-repository.localoih.com"
        - name: ENDPOINT_COMPONENT
          value: "http://component-repository.localoih.com"
        - name: ENDPOINT_SECRETS
          value: "http://skm.localoih.com/api/v1"
        - name: ENDPOINT_DISPATCHER
          value: "http://dispatcher-service.localoih.com"
        - name: ENDPOINT_METADATA
          value: "http://metadata.localoih.com/api/v1"
        - name: ENDPOINT_APP_DIRECTORY
          value: "http://app-directory.localoih.com/api/v1"
        - name: NODE_ENV
          value: development
        - name: LOG_LEVEL
          value: debug
        resources:
          limits:
            cpu: "0.1"
            memory: 500Mi
        volumeMounts:
        - name: code
          mountPath: /usr/src/app
          subPath: services/web-ui
        livenessProbe:
          httpGet:
            port: 3000
            path: /healthcheck
          initialDelaySeconds: 300
          timeoutSeconds: 1
        readinessProbe:
          httpGet:
            port: 3000
            path: /healthcheck
          initialDelaySeconds: 120
          timeoutSeconds: 1
        imagePullPolicy: IfNotPresent
      volumes:
      - name: code
        persistentVolumeClaim:
          claimName: source-volume-claim
  minReadySeconds: 10
  revisionHistoryLimit: 2
