{{$ENABLE_DNSTESTS := DefaultParam .CL2_ENABLE_DNSTESTS false}}
# Guard the new DNS tests. Remove it once it's confirmed that it works on a subset of tests.
{{$USE_ADVANCED_DNSTEST := DefaultParam .CL2_USE_ADVANCED_DNSTEST false}}

# The number of DNS client pods for every 100 nodes.
{{$dnsClientPodsFactor := DefaultParam .CL2_DNS_K8S_HOSTNAMES_CLIENT_PODS_FACTOR 1}}
# Create 5 DNS client pods, plus additional based on the number of nodes.
{{$dnsClientPods := AddInt 5 (MultiplyInt $dnsClientPodsFactor (DivideInt .Nodes 100))}}
{{$qpsPerClient := DefaultParam .CL2_DNS_K8S_HOSTNAMES_PER_CLIENT_QPS 10}}
{{$testDurationMinutes := DefaultParam .CL2_DNS_K8S_HOSTNAMES_TEST_MINUTES 10}}

{{if and $ENABLE_DNSTESTS $USE_ADVANCED_DNSTEST}}
steps:
- name: Run DNS performance test for k8s hostnames
  measurements:
  - Identifier: DNSPerformanceK8sHostnames
    Method: DNSPerformanceK8sHostnames
    Params:
      podReplicas: {{$dnsClientPods}}
      qpsPerClient: {{$qpsPerClient}}
      testDurationMinutes: {{$testDurationMinutes}}

- name: Wait 1m for DNS test to complete
  measurements:
  - Identifier: Wait
    Method: Sleep
    Params:
      duration: 1m
{{end}}
