Completek8s Classroomnotes 05/Aug/2023

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
      Preview
      Preview
  • Lets create jenkins pod with same restrictions as above plus maximum cpu of 0.05

  • 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

Preview
* Refer Here for the changes
* When init container completes then containers start
Preview
* Refer Here for the changes done
Preview
* Refer Here for init containers

Next Session

  • Accounts
    • GCP
    • AWS/AZURE

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner