Hello Moritz
Welcome to Microsoft Q&A Platform, thanks for posting your query here.
Adding to previous response of Manu, In the YAML file you shared, resources-requests
and resources-limits
are used to specify the minimum and maximum amount of CPU and memory resources that each container in the container group requires.
resources-requests
specify the minimum amount of resources that a container requires to run properly. In your example, each container requires 1 CPU core and 0.4 GB of memory.
resources-limits
specify the maximum amount of resources that a container is allowed to use. In your example, each container can use up to 1 CPU core and 0.6 GB of memory.
The requests and limits are used by the container orchestrator to schedule containers on a suitable host that can meet their resource requirements. If a container requires more resources than specified in its limits, it may be terminated or restricted by the container orchestrator to prevent it from overusing the host resources.
In your case, if you want to share the same CPU core between the two containers, you can reduce the CPU request and limit for each container to 0.5 instead of 1. This way, the total CPU required by both containers would be 1, and they can share the same CPU core.
Hope this helps.
If the suggested response helped you resolve your issue, please 'Accept as answer', so that it can help others in the community looking for help on similar topics.