I have a pod with single binary with multiple threads in that application. Is it possible in Kubernetes to assign specific thread to specific CPU core inside the pod. I am aware of way to limit pod to work in specific cores, but my requirement is to manage thread mapping inside the pod to specific cores. Thank you.
1 Answers
The lowest level that you can set up CPU Policies is at Container level. We can divide a Kubernetes cluster into namespaces. If you create a Pod within a namespace that has a default CPU limit, and any container in that Pod does not specify its own CPU limit, then the control plane assigns the default CPU limit to that container. Visit this Official Kubernetes Documentation for more reference.
From the inside of the Container, the only possibility could be RedHat Tuna. Tuna commands can target individual CPUs.
The last possibility is the Static CPU policy which allows containers in Guaranteed pods with integer CPU requests access to exclusive CPUs on the node.
Finally, the following question is useful for you, regarding multi threads and CPU assignments.

- 1,046
- 3
- 10