global:
  ref: master
  project: priority-manager
  gitRepoUrl: git@git.zooxlabs.com:zooxco/driving.git
  createNamespace: true
  vpcId: vpc-043ed6ca2955dd897
  helmChartPath: infra/helm/priority-manager
  istio:
    enabled: false

  jaeger:
    enabled: false
    esUrl: https://vpc-firaoqtbvvqxmuuiwdgzpgeldwao-bgykekya3z6idzpihxclaljmoa.us-west-2.es.amazonaws.com:443

  ingress:
    annotations:
      external-dns.alpha.kubernetes.io/alias: "true"
      external-dns.alpha.kubernetes.io/target: dev-aws.priority-manager.zooxlabs.com

  services:
    merge-priority-manager:
      build:
        context: ci/merge_priority_service/merge_priority_manager
      ingress:
        enabled: true
      livenessProbe:
        failureThreshold: 5
        httpGet:
          path: /health/status
          port: http
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 30
        successThreshold: 1
        timeoutSeconds: 3
      readinessProbe:
        failureThreshold: 5
        httpGet:
          path: /health/status
          port: http
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 30
        successThreshold: 1
        timeoutSeconds: 3
      env:
        MERGE_PRIORITY_MANAGER__POSTGRES__DATABASE_NAME:
          value: "merge_priority_manager"
        MERGE_PRIORITY_MANAGER__POSTGRES__USERNAME:
          value: "merge_priority_manager"
        MERGE_PRIORITY_MANAGER__LOGGING__LEVEL:
          value: "INFO"
        MERGE_PRIORITY_MANAGER__MERGE_PRIORITY_MANAGER_CONTROLLER__ENV:
          value: "dev"
        MERGE_PRIORITY_MANAGER__MERGE_PRIORITY_MANAGER_CONTROLLER__GIT_USER:
          valueFrom:
            secretKeyRef:
              name: zooxbors-git-token
              key: user
        MERGE_PRIORITY_MANAGER__MERGE_PRIORITY_MANAGER_CONTROLLER__GIT_TOKEN:
          valueFrom:
            secretKeyRef:
              name: zooxbors-git-token
              key: token
        MERGE_PRIORITY_MANAGER__MERGE_PRIORITY_MANAGER_CONTROLLER__REDIS_HOST:
          value: "redis-master"
        MERGE_PRIORITY_MANAGER__MERGE_PRIORITY_MANAGER_CONTROLLER__REDIS_PORT:
          value: "6379"
        MERGE_PRIORITY_MANAGER__SNS_TOPIC_ARNS__MAPPINGS:
          valueFrom:
            secretKeyRef:
              name: sns-merge-priority-manager
              key: MERGE_PRIORITY_MANAGER__SNS_TOPIC_ARNS__MAPPINGS
        AWS_ACCESS_KEY_ID:
          valueFrom:
            secretKeyRef:
              name: sns-merge-priority-manager
              key: SNS_AWS_ACCESS_KEY_ID
        AWS_SECRET_ACCESS_KEY:
          valueFrom:
            secretKeyRef:
              name: sns-merge-priority-manager
              key: SNS_AWS_SECRET_ACCESS_KEY
        AWS_DEFAULT_REGION:
          value: us-west-2
      sns:
        create: true
        microcosmSecretMapping:
          key: application/vnd.zoox.pubsub._.created.conflict
          envName: MERGE_PRIORITY_MANAGER__SNS_TOPIC_ARNS__MAPPINGS
      args:
        - migrate-and-run

    merge-conflict-check-daemon:
      build:
        context: ci/merge_priority_service/merge_conflict_check_daemon
      livenessProbe:
        failureThreshold: 3
        exec:
          command:
            - /app/health_check.sh
        initialDelaySeconds: 120
        periodSeconds: 120
        successThreshold: 1
        timeoutSeconds: 3
      readinessProbe:
        failureThreshold: 5
        exec:
          command:
            - test
            - -d
            - /code/driving/.git
        initialDelaySeconds: 120
        periodSeconds: 30
        successThreshold: 1
        timeoutSeconds: 3
      sqs:
        create: true
        subscribeTo: sns-merge-priority-manager
      env:
        MERGE_CONFLICT_CHECK_DAEMON__SQS_CONSUMER__SQS_QUEUE_URL:
          valueFrom:
            secretKeyRef:
              name: sqs-merge-conflict-check-daemon
              key: QUEUE_URL
        MERGE_CONFLICT_CHECK_DAEMON__MERGE_PRIORITY_CLIENT__URL:
          value: "http://merge-priority-manager"
        MERGE_CONFLICT_CHECK_DAEMON__LOCAL_REPO_CLIENT__PATH:
          value: "/code/driving"
        MERGE_CONFLICT_CHECK_DAEMON__LOCAL_REPO_CLIENT__HEALTH_METRICS_PATH:
          value: "/app/health_metrics.json"
        MERGE_CONFLICT_CHECK_DAEMON__GITHUB_REPO_CLIENT__GITHUB_USER:
          valueFrom:
            secretKeyRef:
              name: zooxbors-git-token
              key: user
        MERGE_CONFLICT_CHECK_DAEMON__GITHUB_REPO_CLIENT__GITHUB_TOKEN:
          valueFrom:
            secretKeyRef:
              name: zooxbors-git-token
              key: token
        MERGE_CONFLICT_CHECK_DAEMON__CONFLICT_HANDLER__ENV:
          value: "argocd"
        AWS_ACCESS_KEY_ID:
          valueFrom:
            secretKeyRef:
              name: sqs-merge-conflict-check-daemon
              key: SQS_AWS_ACCESS_KEY_ID
        AWS_SECRET_ACCESS_KEY:
          valueFrom:
            secretKeyRef:
              name: sqs-merge-conflict-check-daemon
              key: SQS_AWS_SECRET_ACCESS_KEY
        AWS_DEFAULT_REGION:
          value: us-west-2
      volumeMounts:
        - name: ssh-key-volume
          mountPath: /ssh-key
      volumes:
        - name: ssh-key-volume
          secret:
            secretName: ssh-key

    priority-frontend:
      build:
        context: ci/merge_priority_service/merge_priority_frontend
      replicaCount: 1
      ingress:
        enabled: true
      containerPort: 80
      env:
        PRIORITY_FRONTEND_PORT:
          value: "80"
        PRIORITY_MANAGER_URL:
          valueFrom:
            configMapKeyRef:
              key: PRIORITY_MANAGER_URL
              name: env-vars

zoox-base:
  enabled: true

ci-pipeline:
  enabled: false
  syncHook: true

sqs-sns:
  enabled: false

rds:
  create: false
  CidrBlocks: "" # e.g. 10.5.128.0/28,10.5.128.16/28
  MasterUsername: postgres
  MultiAZ: "false"

vault-link:
  secrets:
    ssh-key: true
    zooxbors-git-token: true

postgresql:
  enabled: false

  image:
    tag: "9.6"

  nameOverride: postgresql
  fullnameOverride: postgresql

  postgresqlUsername: postgres
  postgresqlPassword: secret

redis:
  enabled: true
  nameOverride: redis
  fullnameOverride: redis

  usePassword: false

  metrics:
    enabled: true
    serviceMonitor:
      enabled: true

  cluster:
    enabled: false
