apiVersion: apps/v1
kind: Deployment
metadata:
  name: component-orchestrator
  namespace: oih-dev-ns
  labels:
    app: component-orchestrator
spec:
  replicas: 1
  selector:
    matchLabels:
      app: component-orchestrator
  template:
    metadata:
      name: component-orchestrator
      labels:
        app: component-orchestrator
    spec:
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      serviceAccountName: component-orchestrator-account
      containers:
      - name: component-orchestrator
        image: "openintegrationhub/component-orchestrator:latest"
        env:
        - name: COMPONENT_REPOSITORY_BASE_URL
          value: "http://component-repository.oih-dev-ns.svc.cluster.local:1234"
        - name: SNAPSHOTS_SERVICE_BASE_URL
          value: "http://snapshots-service.oih-dev-ns.svc.cluster.local:1234"
        - name: SECRET_SERVICE_URL
          value: "http://secret-service.oih-dev-ns.svc.cluster.local:3000/api/v1"
        - name: ATTACHMENT_STORAGE_SERVICE_BASE_URL
          value: "http://attachment-storage-service.oih-dev-ns.svc.cluster.local:3002"
        - name: "INTROSPECT_ENDPOINT_BASIC"
          value: "http://iam.oih-dev-ns.svc.cluster.local:3099/api/v1/tokens/introspect"
        - name: IAM_TOKEN
          valueFrom:
            secretKeyRef:
              name: shared-secret
              key: iamtoken
        - name: LISTEN_PORT
          value: "1234"
        - name: LOG_LEVEL
          value: trace
        - name: MONGODB_URI
          valueFrom:
            secretKeyRef:
              name: shared-secret
              key: componentOrchestratorMongourl
        - name: RABBITMQ_URI
          value: >-
            amqp://guest:guest@rabbitmq-service.oih-dev-ns.svc.cluster.local
        - name: RABBITMQ_URI_FLOWS
          value: >-
            amqp://rabbitmq-service.oih-dev-ns.svc.cluster.local
        - name: RABBITMQ_MANAGEMENT_URI
          value: >-
            http://guest:guest@rabbitmq-service.oih-dev-ns.svc.cluster.local:15672/
        - name: SELF_URL
          value: "http://api-service.oih-dev-ns.svc.cluster.local"
        livenessProbe:
          httpGet:
            port: 1234
            path: /healthcheck
        readinessProbe:
          httpGet:
            port: 1234
            path: /healthcheck
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        imagePullPolicy: Always
        securityContext:
          privileged: false
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
