DMCA.com Protection Status Trending Topics About Devops: Create Pods with CPU Limit and Range in the default namespace

Tuesday, 25 May 2021

Create Pods with CPU Limit and Range in the default namespace

 

Pod with limit

Create a pod definition that requests for CPU more than 200m and less than 800m

vim pod-with-cpu-within-range.yml
apiVersion: v1
kind: Pod
metadata:
  name: pod-with-cpu-within-range
spec:
  containers:
  - name: pod-with-cpu-within-range
    image: nginx
    resources:
      limits:
        cpu: "800m"
      requests:
        cpu: "500m"

pod-with-cpu-within-range-definition

List the existing pods and create a new pod with the file created in the above step.

kubectl get pods
kubectl create -f pod-with-cpu-within-range.yml
kubectl get pods
kubectl describe pod pod-with-cpu-within-range

create-pod-with-cpu-within-range

No comments: