---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: osdu-crs-conversion
  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-conversion
    installationType: osduReference
    subset: m24
    replicaCount: 1
    service:
      type: ClusterIP
      port: 80
    configuration:
    - service: crs-conversion
      path: /api/crs/converter/
      hosts:
        - "*"
      gateways:
        - istio-system/internal-gateway
        - istio-system/external-gateway
      repository: community.opengroup.org:5555/osdu/platform/system/reference/crs-conversion-service/crs-conversion-service-release-0-27
      tag: latest
      probe:
        path: /api/crs/converter/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/converter/v3/info"
          - "/api/crs/converter/swagger*"
          - "/api/crs/converter/api-docs*"
          - "/api/crs/converter/webjars/*"
      pvc:
      - name: share-crs-conversion
        existing: true
        volume: shared-data
      mount:
      - name: shared-data
        path: /mnt/crs_conversion
        subPath: crs-conversion
      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-conversion-service"
      - name: SERVER_SERVLET_CONTEXTPATH
        value: "/api/crs/converter/"
      - name: SERVICE_DOMAIN_NAME
        value: "dataservices.energy"
      - name: SIS_DATA
        value: /apachesis_setup/SIS_DATA
      - 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"   
      - name: STORAGE_URL
        value: http://storage.osdu-core.svc.cluster.local/api/storage/v2 