kind: Deployment
apiVersion: apps/v1
metadata:
  name: component-repository
  namespace: oih-dev-ns
  labels:
    app: component-repository
spec:
  replicas: 1
  selector:
    matchLabels:
      app: component-repository
  template:
    metadata:
      name: component-repository
      labels:
        app: component-repository
    spec:
      containers:
        - name: component-repository
          image: 'openintegrationhub/component-repository:latest'
          env:
            - name: MONGODB_URI
              valueFrom:
                secretKeyRef:
                  name: shared-secret
                  key: componentRepoMongourl
            - name: PORT
              value: '1234'
            - name: IAM_TOKEN
              valueFrom:
                secretKeyRef:
                  name: shared-secret
                  key: iamtoken
            - name: LOG_LEVEL
              value: trace
            - name: "INTROSPECT_ENDPOINT_BASIC"
              value: "http://iam.oih-dev-ns.svc.cluster.local:3099/api/v1/tokens/introspect"
            - name:  CORS_ORIGIN_WHITELIST
              value: 'localoih.com,http://web-ui.localoih.com'
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
          livenessProbe:
            httpGet:
              path: /healthcheck
              port: 1234
          readinessProbe:
            httpGet:
              path: /healthcheck
              port: 1234
          securityContext:
            privileged: false
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
