---
# Limits for coredns

# uncomment the line below to customize the DNS cpu limit value
# dns_cpu_limit: 300m
dns_memory_limit: 300Mi
dns_cpu_requests: 100m
dns_memory_requests: 70Mi
dns_min_replicas: "{{ [2, groups['k8s_cluster'] | length] | min }}"
dns_nodes_per_replica: 16
dns_cores_per_replica: 256
dns_prevent_single_point_failure: "{{ 'true' if dns_min_replicas | int > 1 else 'false' }}"
enable_coredns_reverse_dns_lookups: true
coredns_svc_name: "coredns"
coredns_ordinal_suffix: ""
# dns_extra_tolerations: [{effect: NoSchedule, operator: "Exists"}]
coredns_affinity:
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
    - weight: 100
      podAffinityTerm:
        labelSelector:
          matchExpressions:
          - key: k8s-app
            operator: In
            values: ["kube-dns"]
        topologyKey: kubernetes.io/hostname
coredns_deployment_nodeselector: "kubernetes.io/os: linux"
coredns_default_zone_cache_block: |
  cache 30

coredns_pod_disruption_budget: false
# when enable_dns_autoscaler is false, coredns_replicas is used to set the number of replicas
coredns_replicas: 2
# value for coredns pdb
coredns_pod_disruption_budget_max_unavailable: "30%"
deploy_coredns: true
# coredns_additional_configs adds any extra configuration to coredns
# coredns_additional_configs: |
#   whoami
#   local

# coredns_rewrite_block: |
#   rewrite stop {
#     name regex (.*)\.my\.domain {1}.svc.cluster.local
#     answer name (.*)\.svc\.cluster\.local {1}.my.domain
#   }

# coredns_additional_error_config: |
#   consolidate 5m ".* i/o timeout$" warning

# Configure coredns and nodelocaldns to correctly answer DNS queries when you changed
# your 'dns_domain' and some workloads used it directly.
old_dns_domains: []

# dns_upstream_forward_extra_opts apply to coredns forward section as well as nodelocaldns upstream target forward section
# dns_upstream_forward_extra_opts:
#   policy: sequential

# Apply extra options to coredns kubernetes plugin
# coredns_kubernetes_extra_opts:
#   - 'fallthrough example.local'

# nodelocaldns
nodelocaldns_cpu_requests: 100m
nodelocaldns_memory_limit: 200Mi
nodelocaldns_memory_requests: 70Mi
nodelocaldns_ds_nodeselector: "kubernetes.io/os: linux"
nodelocaldns_prometheus_port: 9253
nodelocaldns_secondary_prometheus_port: 9255

# nodelocaldns_additional_configs adds any extra configuration to coredns
# nodelocaldns_additional_configs: |
#   whoami
#   local

# Limits for dns-autoscaler
dns_autoscaler_cpu_requests: 20m
dns_autoscaler_memory_requests: 10Mi
dns_autoscaler_deployment_nodeselector: "kubernetes.io/os: linux"
# dns_autoscaler_extra_tolerations: [{effect: NoSchedule, operator: "Exists"}]
dns_autoscaler_affinity: {}

# etcd metrics
# etcd_metrics_service_labels:
#   k8s-app: etcd
#   app.kubernetes.io/managed-by: Kubespray
#   app: kube-prometheus-stack-kube-etcd
#   release: prometheus-stack

# Policy Controllers
# policy_controller_extra_tolerations: [{effect: NoSchedule, operator: "Exists"}]
