k8s.io/perf-tests/clusterloader2@v0.0.0-20240304094227-64bdb12da87e/testing/load/modules/pod-startup-latency.yaml (about)

     1  ## Pod-startup-latency module provides a module for latency pod measurements
     2  
     3  ## Input Params
     4  {{$namespaces := .namespaces}}
     5  {{$minPodsInSmallCluster := .minPodsInSmallCluster}}
     6  {{$image := .image}}
     7  
     8  ## CL2 Params
     9  # LATENCY_POD_MEMORY and LATENCY_POD_CPU are calculated for 1-core 4GB node.
    10  # Increasing allocation of both memory and cpu by 5%
    11  # decreases the value of priority function in scheduler by one 5 points.
    12  # This results in decreased probability of choosing the same node again.
    13  # TODO(https://github.com/kubernetes/perf-tests/issues/1024): See whether we can get rid of this
    14  {{$LATENCY_POD_CPU := DefaultParam .CL2_LATENCY_POD_CPU 50}}
    15  {{$LATENCY_POD_MEMORY := DefaultParam .CL2_LATENCY_POD_MEMORY 200}}
    16  {{$LATENCY_POD_COUNT := DefaultParam .CL2_LATENCY_POD_COUNT $minPodsInSmallCluster}}
    17  {{$SCHEDULER_NAME := DefaultParam .CL2_SCHEDULER_NAME "default-scheduler"}}
    18  
    19  ## Variables
    20  {{$latencyReplicas := Ceil (DivideFloat $LATENCY_POD_COUNT $namespaces)}}
    21  {{$podStartupLatencyThreshold := DefaultParam .CL2_POD_STARTUP_LATENCY_THRESHOLD "5s"}}
    22  {{$CHECK_IF_PODS_ARE_UPDATED := DefaultParam .CL2_CHECK_IF_PODS_ARE_UPDATED true}}
    23  
    24  steps:
    25  - name: Starting latency pod measurements
    26    measurements:
    27      - Identifier: PodStartupLatency
    28        Method: PodStartupLatency
    29        Params:
    30          action: start
    31          labelSelector: group = latency
    32          threshold: {{$podStartupLatencyThreshold}}
    33      - Identifier: WaitForRunningLatencyDeployments
    34        Method: WaitForControlledPodsRunning
    35        Params:
    36          action: start
    37          checkIfPodsAreUpdated: {{$CHECK_IF_PODS_ARE_UPDATED}}
    38          apiVersion: apps/v1
    39          kind: Deployment
    40          labelSelector: group = latency
    41          operationTimeout: 15m
    42  - name: Creating latency pods
    43    phases:
    44      - namespaceRange:
    45          min: 1
    46          max: {{$namespaces}}
    47        replicasPerNamespace: {{$latencyReplicas}}
    48        tuningSet: Uniform5qps
    49        objectBundle:
    50          - basename: latency-deployment
    51            objectTemplatePath: simple-deployment.yaml
    52            templateFillMap:
    53              Replicas: 1
    54              Group: latency
    55              CpuRequest: {{$LATENCY_POD_CPU}}m
    56              MemoryRequest: {{$LATENCY_POD_MEMORY}}M
    57              Image: {{$image}}
    58  - name: Waiting for latency pods to be running
    59    measurements:
    60      - Identifier: WaitForRunningLatencyDeployments
    61        Method: WaitForControlledPodsRunning
    62        Params:
    63          action: gather
    64  - name: Deleting latency pods
    65    phases:
    66      - namespaceRange:
    67          min: 1
    68          max: {{$namespaces}}
    69        replicasPerNamespace: 0
    70        tuningSet: default
    71        objectBundle:
    72          - basename: latency-deployment
    73            objectTemplatePath: simple-deployment.yaml
    74  - name: Waiting for latency pods to be deleted
    75    measurements:
    76      - Identifier: WaitForRunningLatencyDeployments
    77        Method: WaitForControlledPodsRunning
    78        Params:
    79          action: gather
    80  - name: Collecting pod startup latency
    81    measurements:
    82      - Identifier: PodStartupLatency
    83        Method: PodStartupLatency
    84        Params:
    85          action: gather
    86          schedulerName: {{$SCHEDULER_NAME}}