text stringlengths 0 59.1k |
|---|
# source: k8s_examples/_archived/cpu-manager/be.yaml type: yaml |
apiVersion: v1 |
kind: Pod |
metadata: |
name: be |
spec: |
containers: |
- image: quay.io/connordoyle/cpuset-visualizer |
name: be |
<|endoftext|> |
# source: k8s_examples/_archived/cpu-manager/exclusive-4.yaml type: yaml |
apiVersion: v1 |
kind: Pod |
metadata: |
name: exclusive-4 |
spec: |
containers: |
- image: quay.io/connordoyle/cpuset-visualizer |
name: exclusive-4 |
resources: |
requests: |
cpu: 4 |
memory: "256M" |
limits: |
cpu: 4 |
memory: "256M" |
<|endoftext|> |
# source: k8s_examples/_archived/cpu-manager/README.md type: docs |
# CPU Manager Example |
This example flow uses a pre-built docker image based on |
[cpuset-visualizer](https://github.com/ConnorDoyle/cpuset-visualizer). |
Each container run here hosts an endpoint serving an up-to-the-second |
system representation generated by |
[`lstopo`](https://www.open-mpi.org/projects/hwloc). |
## 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 |
 |
<|endoftext|> |
# source: k8s_examples/_archived/cpu-manager/exclusive-2.yaml type: yaml |
apiVersion: v1 |
kind: Pod |
metadata: |
name: exclusive-2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.