---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: osdu-search
  namespace: osdu-core
  annotations:
    clusterconfig.azure.com/use-managed-source: "true"
spec:
  dependsOn:
    - name: osdu-indexer-queue
      namespace: osdu-core
  targetNamespace: osdu-core
  chart:
    spec:
      chart: ./charts/osdu-developer-service
      sourceRef:
        kind: GitRepository
        name: flux-system
        namespace: flux-system
  interval: 5m0s
  timeout: 6m
  install:
    remediation:
      retries: 3
  valuesFrom:
    - kind: ConfigMap
      name: configmap-software
      valuesKey: value.yaml
  values:
    nameOverride: search
    installationType: osduCore
    subset: m24
    replicaCount: 1
    service:
      type: ClusterIP
      port: 80
    configuration:
    - service: search
      path: /api/search/v2/
      hosts:
        - "*"
      gateways:
        - istio-system/internal-gateway
        - istio-system/external-gateway
      repository: community.opengroup.org:5555/osdu/platform/system/search-service/search-service-
      tag: latest
      probe:
        path: /actuator/health
        port: 8081
        liveness:
          delay: 250
          seconds: 10
      keyvault: true
      request:
        cpu: 1000m
        memory: 1Gi
      auth:
        disable:
          - "*/actuator/health"
          - "*/health"
          - "*/_ah/**"
          - "*/configuration/ui"
          - "*/configuration/security"
          - "/api/search/v2/info"
          - "/api/search/v2/swagger*"
          - "/api/search/v2/api-docs*"
          - "/api/search/v2/webjars/*"
      env:
      - name: KEYVAULT_URI
        secret:
          name: azure-resources
          key: keyvault-uri
      - name: AAD_CLIENT_ID
        secret:
          name: active-directory
          key: principal-clientid
      - name: APPINSIGHTS_KEY
        secret:
          name: azure-resources
          key: insights-key
      - name: APPLICATIONINSIGHTS_CONNECTION_STRING
        secret:
          name: azure-resources
          key: insights-connection
      - name: AZURE_ISTIOAUTH_ENABLED
        value: "true"
      - name: AZURE_PAAS_WORKLOADIDENTITY_ISENABLED
        value: "true"
      - name: SERVER_PORT
        value: "80"
      - name: ACCEPT_HTTP
        value: "true"
      - name: SPRING_APPLICATION_NAME
        value: search
      - name: SERVER_SERVLET_CONTEXTPATH
        value: /api/search/v2/
      - name: LOG_PREFIX
        value: "search"
      - name: SEARCH_SERVICE_SPRING_LOGGING_LEVEL
        value: "DEBUG"
      - name: COSMOSDB_DATABASE
        value: "osdu-db"
      - name: REDIS_DATABASE
        value: "5"
      - name: ENVIRONMENT
        value: "evt"
      - name: ELASTIC_CACHE_EXPIRATION
        value: 1
      - name: MAX_CACHE_VALUE_SIZE
        value: 60
      - name: POLICY_SERVICE_ENABLED
        value: "false"
      - name: ENTITLEMENTS_SERVICE_API_KEY
        value: "OBSOLETE"
      - name: PARTITION_SERVICE_ENDPOINT
        value: "http://partition/api/partition/v1"
      - name: ENTITLEMENTS_SERVICE_ENDPOINT
        value: "http://entitlements/api/entitlements/v2"
      - name: POLICY_SERVICE_ENDPOINT
        value: http://policy/api/policy/v1