# Openshift Jfrog Xray
xray:
  unifiedUpgradeAllowed: true
  replicaCount: 1
  xray:
    consoleLog: false
    jfrogUrl: "OVERRIDE"
  postgresql:
    enabled: false
  database:
    url: "OVERRIDE"
    user: "OVERRIDE"
    password: "OVERRIDE"
  initContainerImage: registry.connect.redhat.com/jfrog/init:7.46.11
  common:
    rabbitmq:
      connectionConfigFromEnvironment: true
    xrayUserId: "1000721035"
    xrayGroupId: "1000721035"
    xrayVersion: "3.60.2"
    customInitContainers: |
      - name: "prepare-uid-persistent-volume"
        image: "{{ .Values.initContainerImage }}"
        imagePullPolicy: "{{ .Values.imagePullPolicy }}"
        command:
          - 'sh'
          - '-c'
          - >
            chown -Rv {{ .Values.common.xrayUserId }}:{{ .Values.common.xrayGroupId }} {{ .Values.xray.persistence.mountPath }}
        securityContext:
            runAsUser: 0
        volumeMounts:
          - mountPath: "{{ .Values.xray.persistence.mountPath }}"
            name: data-volume
  analysis:
    name: xray-analysis
    image:
      registry: registry.connect.redhat.com
      repository: jfrog/xray-analysis
    updateStrategy: RollingUpdate
    podManagementPolicy: Parallel
    preStartCommand:
  indexer:
    name: xray-indexer
    image:
      registry: registry.connect.redhat.com
      repository: jfrog/xray-indexer
    updateStrategy: RollingUpdate
    podManagementPolicy: Parallel
  persist:
    name: xray-persist
    image:
      registry: registry.connect.redhat.com
      repository: jfrog/xray-persist
    updateStrategy: RollingUpdate
    podManagementPolicy: Parallel
    persistence:
      size: 10Gi
    preStartCommand:
  server:
    name: xray-server
    image:
      registry: registry.connect.redhat.com
      repository: jfrog/xray-server
    updateStrategy: RollingUpdate
    podManagementPolicy: Parallel
    replicaCount: 1
  router:
    name: router
    image:
      registry: registry.connect.redhat.com
      repository: jfrog/xray-router
      imagePullPolicy: IfNotPresent
      tag: 3.60.2
  
  # RabbitMQ
  ## Configuration values for the rabbitmq dependency
  ## ref: https://github.com/bitnami/charts/blob/master/bitnami/rabbitmq/README.md
  rabbitmq:
    enabled: true
    replicaCount: 1
    rbac:
      create: true
    
    image: 
      registry: registry.connect.redhat.com
      repository: jfrog/xray-rabbitmq
      tag: 3.60.2

    podSecurityContext:
      fsGroup: 1000721001
      runAsUser: 1000721001
   
    
    auth:
      username: xray
      password: xray
      # existingPasswordSecret: name-of-existing-secret
      ## Alternatively, you can use a pre-existing secret with a key called rabbitmq-password by specifying existingPasswordSecret
      # existingPasswordSecret: <name-of-existing-secret>
      erlangCookie: XRAYRABBITMQCLUSTER
      # existingErlangSecret: <name-of-existing-secret>
      ## Enable encryption to rabbitmq
      ## ref: https://www.rabbitmq.com/ssl.html
      ##
    
      tls:
        enabled: false
        failIfNoPeerCert: true
        sslOptionsVerify: verify_peer
        #caCertificate: |-
        #serverCertificate: |-
        #serverKey: |-
    

    

    livenessProbe:
      initialDelaySeconds: 120
      periodSeconds: 10
      timeoutSeconds: 5
      failureThreshold: 6
      exec:
        command:
          - /bin/sh
          - -c
          - 'rabbitmqctl status'
    readinessProbe:
      initialDelaySeconds: 20
      periodSeconds: 5
      timeoutSeconds: 3
      failureThreshold: 6
      exec:
        command:
          - /bin/sh
          - -c
          - 'rabbitmqctl status'
