Technical questionAccepted answer
One or more containers do not have resource limits - warning in VS Code Kubernetes tools
Rushikesh Sabde
Sep 26
0 views1
After creating the pod-definition.yml file.
apiVersion: v1
kind: Pod
metadata:
name: myapp-pod
labels:
app: myapp
type: server
spec:
containers:
- name: nginx-container
image: nginx
The linter is giving this warning.
One or more containers do not have resource limits - this could starve other processes
1 answer
Accepted answer · original discussion
Jonas
PermalinkSep 26
It is a good practice to declare resource requests and limits for both memory and cpu for each container. This helps to schedule the container to a node that has available resources for your Pod, and also so that your Pod does not use resources that other Pods needs - therefore the "this could starve other processes" message.
E.g. to add resource requests and limits to your example
apiVersion: v1
kind: Pod
metadata:
name: myapp-pod
labels:
app: myapp
type: server
spec:
containers:
- name: nginx-container
image: nginx
resources:
limits:
memory: 512Mi
cpu: "1"
requests:
memory: 256Mi
cpu: "0.2"
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.