Restrictions for Kubernetes Pods in terms of Resources
- Refer Here for Resource Management in K8s for Pods and containers
- Lets create a pod spec which specifies
- minimum 100 MiB RAM to Jenkins container
- maximum 256 MiB RAM to Jenkins container
- Refer Here for the spec
-
Lets create jenkins pod with same restrictions as above plus maximum cpu of 0.05
- Refer Here for the changes
-
Pod specification is all about containers, but in reality we might need to control Pods not containers, We have other kuberenetes resources such as
- Replica Sets
- Deployments
- Daemonsets
- Statefulsets etc
- Job
- CronJob
-
Pods in k8s have
- containers
- ephemeralContainers
- initContainers
- Experiment: Refer Here to run a disaster.yaml file which contains 3 types of containers (note: this is not the way it is supposed to be)
- Pod never starts:
---
apiVersion: v1
kind: Pod
metadata:
name: actvity1
spec:
containers:
- name: jenkins
image: jenkins/jenkins:lts-jdk11
initContainers:
- name: jenkinsi
image: jenkins/jenkins:lts-jdk11
* Refer Here for the changes
* When init container completes then containers start
* Refer Here for the changes done
* Refer Here for init containers
Next Session
- Accounts
- GCP
- AWS/AZURE