tls:
  enabled: ${tobool(tls)}

metrics:
  enabled: true
  serviceMonitor:
    enabled: true
    namespace: monitoring

ingress:
  enabled: ${tobool(admin)}
  tls: ${tobool(tls)}
  ingressClassName: ${ingressClass}
  hostname: ${admin_service_uri}
  annotations:
    kubernetes.io/ingress.class: ${ingressClass}
    %{ if tls }cert-manager.io/cluster-issuer: letsencrypt%{ endif }
    %{ if ingressClass == "traefik" && tls }
    traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
    traefik.ingress.kubernetes.io/router.middlewares: default-redirect-to-https@kubernetescrd,default-preserve-host-headers@kubernetescrd
    %{ else }
    %{ if ingressClass == "traefik" }
    traefik.ingress.kubernetes.io/router.entrypoints: web
    traefik.ingress.kubernetes.io/router.middlewares: default-preserve-host-headers@kubernetescrd
    %{ endif }
    %{ endif }
    %{ if ingressClass == "nginx" }
    ingress.kubernetes.io/proxy-body-size: "0"
    nginx.ingress.kubernetes.io/proxy-body-size: "0"
    %{ endif }
    %{ if displayOnHomepage }
    gethomepage.dev/enabled: "true"
    gethomepage.dev/name: "Minio"
    gethomepage.dev/description: "S3-Compatible cloud storage"
    gethomepage.dev/group: "Tools"
    gethomepage.dev/icon: "minio.png"
    %{ endif }

apiIngress:
  enabled: true
  ingressClassName: ${ingressClass}
  tls: ${tobool(tls)}
  hostname: ${service_uri}
  annotations:
    kubernetes.io/ingress.class: ${ingressClass}
    %{ if tls }cert-manager.io/cluster-issuer: letsencrypt%{ endif }
    %{ if ingressClass == "traefik" && tls }
    traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
    traefik.ingress.kubernetes.io/router.middlewares: default-redirect-to-https@kubernetescrd,default-preserve-host-headers@kubernetescrd
    %{ else }
    %{ if ingressClass == "traefik" }
    traefik.ingress.kubernetes.io/router.entrypoints: web
    traefik.ingress.kubernetes.io/router.middlewares: default-preserve-host-headers@kubernetescrd
    %{ endif }
    %{ endif }
    %{ if ingressClass == "nginx" }
    ingress.kubernetes.io/proxy-body-size: "0"
    nginx.ingress.kubernetes.io/proxy-body-size: "0"
    %{ endif }

affinity:
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
    - weight: 100
      podAffinityTerm:
        labelSelector:
          matchLabels:
            app.kubernetes.io/name: minio
        topologyKey: kubernetes.io/hostname