examples/staging/cpu-manager
Bob Killen 541b5bb39b
staging/cpu-manager: Remove inactive OWNERS
As a part of cleaning up inactive members (those with no activity within
the past 18 months) from OWNERS files, this commit moves balajismaniam
from an approver to an emeritus_approver.
2021-02-21 10:45:20 -05:00
..
OWNERS staging/cpu-manager: Remove inactive OWNERS 2021-02-21 10:45:20 -05:00
README.md Fix cpu-manager README links 2018-10-10 00:33:48 -03:00
be.yaml Import kubernetes updates (#210) 2018-03-14 11:26:26 -07:00
exclusive-1.yaml Import kubernetes updates (#210) 2018-03-14 11:26:26 -07:00
exclusive-2.yaml Import kubernetes updates (#210) 2018-03-14 11:26:26 -07:00
exclusive-3.yaml Import kubernetes updates (#210) 2018-03-14 11:26:26 -07:00
exclusive-4.yaml Import kubernetes updates (#210) 2018-03-14 11:26:26 -07:00
pod-ips Import kubernetes updates (#210) 2018-03-14 11:26:26 -07:00
shared.yaml Import kubernetes updates (#210) 2018-03-14 11:26:26 -07:00

README.md

CPU Manager Example

This example flow uses a pre-built docker image based on cpuset-visualizer. Each container run here hosts an endpoint serving an up-to-the-second system representation generated by lstopo.

Setup

  1. Start a local cluster with the static CPU manager policy enabled :

    sudo PATH=$PATH \
      KUBELET_FLAGS="\
      --feature-gates=CPUManager=true \
      --cpu-manager-policy=static \
      --cpu-manager-reconcile-period=5s \
      --kube-reserved=cpu=500m" \
      ./hack/local-up-cluster.sh
    

Run pods

The example pods are in the /examples/staging/cpu-manager directory of the Kubernetes source tree. Your ability to run all of the example pods simultaneously depends on how many CPUs are available on the test system.

The required CPUs for each example pod are listed below:

 POD              | CPUs
------------------|---------
 be.yaml          | >= 1 CPU
 shared.yaml      | >= 1 CPU
 exclusive-1.yaml | >= 2 CPU
 exclusive-2.yaml | >= 3 CPU
 exclusive-3.yaml | >= 4 CPU
 exclusive-4.yaml | >= 5 CPU

Example

Run a pod with a single container in the shared pool, and another pod with a single container in an exclusive cpuset with one CPU.

$ kubectl create -f examples/staging/cpu-manager/shared.yaml
$ kubectl create -f examples/staging/cpu-manager/exclusive-1.yaml

To list IP addresses of the pods running in the local cluster, do:

$ watch ./examples/staging/cpu-manager/pod-ips
exclusive-1 http://172.17.0.4
shared http://172.17.0.3

Sample cpuset-visualizer output

Sample cpuset-visualizer output