---
kind: ConfigMap
apiVersion: v1
metadata:
  name: petclinic-config
  namespace: spring-petclinic
data:
  application.yaml: |-
    server:
      shutdown: graceful
      lifecycle:
        timeout-per-shutdown-phase: 15
      port: 8080
      compression:
        enabled: true
        mime-types: application/json,text/css,application/javascript
        min-response-size: 2048


    # Logging
    logging.level.org.springframework: INFO
    logging.pattern.level: '%d{yyyy-MM-dd HH:mm:ss.SSS} %5p [%X{principal}-%X{X-B3-TraceId:-}] %m%n'


    # Metrics
    management:
      endpoint:
        restart:
          enabled: true
        metrics:
          enabled: true
        prometheus:
          enabled: true
      metrics:
        export:
          prometheus:
            enabled: true
      endpoints:
        web:
          exposure:
            include: '*'
      health:
        probes:
          enabled: true

    customers-service-id: http://customers-service.spring-petclinic.svc.cluster.local:8080
    visits-service-id: http://visits-service.spring-petclinic.svc.cluster.local:8080

    spring:
      main.banner-mode: off
      datasource:
        schema: classpath*:db/mysql/schema.sql
        data: classpath*:db/mysql/data.sql
        platform: mysql
        initialization-mode: always

      jpa:
        show-sql: true
        hibernate:
          ddl-auto: none
          generate-ddl: false
      zipkin:
          base-url: http://zipkin.istio-system:9411
          discovery-client-enabled: true
      sleuth:
        web:
          client:
            enabled: false
        sampler:
          probability: 1.0
      messages:
        basename: messages/messages
      cloud:
        kubernetes:
          discovery:
            enabled: true
        loadbalancer:
          ribbon:
            enabled: false
        gateway:
          x-forwarded:  
            enabled: true 
            for-enabled: true 
            proto-enabled: true 
            host-append: false  
            port-append: false  
          routes:
            - id: vets-service
              uri: http://vets-service.spring-petclinic.svc.cluster.local:8080
              predicates:
                - Path=/api/vet/**
              filters:
                - StripPrefix=2
            - id: visits-service
              uri: http://visits-service.spring-petclinic.svc.cluster.local:8080
              predicates:
                - Path=/api/visit/**
              filters:
                - StripPrefix=2
            - id: customers-service
              uri: http://customers-service.spring-petclinic.svc.cluster.local:8080
              predicates:
                - Path=/api/customer/**
              filters:
                - StripPrefix=2
    vets:
      cache:
        ttl: 60
        heap-size: 101

#opentracing:
#  jaeger:
#    enable-b3-propagation: true
#    enabled: true
#    udp-sender:
#      host: jaeger-agent.istio-system
#  spring:
#    cloud:
#      scheduled:
#        skip-pattern: '.*KubernetesCatalogWatch'
