Skip to content

lifoongchan/kubernetes-resources-requests-and-limits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Updating Kubernetes Resources Requests and Limits

# personal study note

Deploying pod without resource requests causes lack of specifying required amounts of CPU and memory, leading to scheduling pods on unsuitable nodes with insufficient processing power or memory. On the other hand, starting pods without resource limits results in indefinitely use of CPU or memory, causing node failure or performance issues when the resources are finished. Well-configured containers should inform Kubernetes the amount of memory and CPU used in reserving on a worker node

Resource requests and limits set up

  1. add resource sections under image in deployment.yaml (by referencing to https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/)

  2. "kubectl apply -f (deployment).yaml" applies and updates deployment.yaml

  3. "kubectl get pods -n development" gets pods from the development namespace -> old pods without resource requests and limits are terminating
    -> new pods with updated respurce requests and limits are running


Encountered Errors

1) Unable to connect to the server: dial tcp 127.0.0.1 xxxx -> Kubernetes is not running
i) open docker
ii) make sure Kubernetes is started by running "minikube start"
expected outcome: "Done! kubectl is now configured to use "minikube" cluster"
iii) check if Kubernetes displays the correct cluster information
expected outcome: "Kubernetes control plane is running at https://127.0.0.1:54747"

2) Error: error parsing .yaml: xxxx -> the specific yaml file has some issues - indentation problems in this case

Additional info

Resources = the amount of available CPU and memory on worker node

Node = a worker machine (- physical or virtual machine) that runs containers and is managed by the control plane of the cluster

Releases

No releases published

Packages

No packages published