• Ismo Puustinen's avatar
    cpumanager: validate topology in static policy. · 4f604eb7
    Ismo Puustinen authored
    This patch adds a check for the static policy state validation. The
    check fails if the CPU topology obtained from cadvisor doesn't match
    with the current topology in the state file.
    
    If the CPU topology has changed in a node, cpu manager static policy
    might try to assign non-present cores to containers.
    
    For example in my test case, static policy had the default CPU set of
    0-1,4-7. Then kubelet was shut down and CPU 7 was offlined. After
    restarting the kubelet, CPU manager tries to assign the non-existent CPU
    7 to containers which don't have exclusive allocations assigned to them:
    
     Error response from daemon: Requested CPUs are not available - requested 0-1,4-7, available: 0-6)
    
    This breaks the exclusivity, since the CPUs from the shared pool don't
    get assigned to non-exclusive containers, meaning that they can execute
    on the exclusive CPUs.
    4f604eb7
policy_static.go 8.64 KB