---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: osdu-crs-catalog
  namespace: osdu-reference
  annotations:
    clusterconfig.azure.com/use-managed-source: "true"
spec:
  dependsOn:
    - name: osdu-developer-base-reference
      namespace: default
  targetNamespace: osdu-reference
  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: crs-catalog
    installationType: osduReference
    subset: m24
    replicaCount: 1
    service:
      type: ClusterIP
      port: 80
    configuration:
    - service: crs-catalog
      path: /api/crs/catalog/
      hosts:
        - "*"
      gateways:
        - istio-system/internal-gateway
        - istio-system/external-gateway
      repository: community.opengroup.org:5555/osdu/platform/system/reference/crs-catalog-service/crs-catalog-service-release-0-27
      tag: latest
      probe:
        path: /api/crs/catalog/swagger-ui/index.html
        port: http
        liveness:
          delay: 250
          seconds: 10
      keyvault: true
      auth:
        disable:
          - "*/actuator/health"
          - "*/health"
          - "*/_ah/**"
          - "*/configuration/ui"
          - "*/configuration/security"
          - "/api/crs/catalog/v3/info"
          - "/api/crs/catalog/swagger*"
          - "/api/crs/catalog/api-docs*"
          - "/api/crs/catalog/webjars/*"
      pvc:
      - name: share-crs
        existing: true
        volume: shared-data
      mount:
      - name: shared-data
        path: /mnt/crs_catalogs
      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_PODIDENTITY_ISENABLED
        value: "true"
      - name: SERVER_PORT
        value: "80"
      - name: ACCEPT_HTTP
        value: "true"
      - name: SPRING_APPLICATION_NAME
        value: "crs-catalog-service"
      - name: SERVER_SERVLET_CONTEXTPATH
        value: "/api/crs/catalog/"
      - name: PARTITION_SERVICE_ENDPOINT
        value: "http://partition.osdu-core.svc.cluster.local/api/partition/v1"
      - name: ENTITLEMENT_URL
        value: "http://entitlements.osdu-core.svc.cluster.local/api/entitlements/v2"