DevOps Classroom notes 21/Jun/2026

Pods

  • Pod is an atomic unit of creation in k8s
  • Think of Pod as a small package with one or more containers in it
  • Every pod will get an unique ip in the k8s cluster
  • Containers in the Pod have shared resources i.e.
    • shared network
    • shared storage

Preview

  • Consider typical application
    Preview
  • If we have to run this in containers, we run each component in a container
    Preview
  • When it comes it pods consider the following
    Preview
  • Each Pod can be scaled horizontally or vertically with other k8s workloads
  • When pod has more that one containers, the primary container is referred as maincar and all the other containers are referred as sidecars

Interaction with k8s cluster

  • To interact with k8s we can use any client which can sent http(s) requests. k8s gives two simple options

    • kubectl: A cli tool to interact with k8s api-server
    • client libraries: Refer Here
      Preview
  • k8s api-server is by default https and the default configuration of k8s requires client to be authorized to communicate with k8s cluster.
  • Note: when we installed kubeadm, on the master node we have a file called as kube-config file ~/.kube/config which contains certificate data and api-server urls to connect

kubectl

  • kubectl is a cli and it can be installed directly on any system
  • Refer Here for installation
  • k8s allows to be interacted from kubectl in two ways

    • with commands (imperative): we construct a command based on what we want
      Preview
    • with manifest files (declarative): we create a yaml file based on what we want and apply the file
      Preview
      Preview
  • We would use declartive approach for regular activities.

Lets play with pods

  • Today lets focus on imperative way of creating Pods

Create a pod with a name web1 with httpd container in it

  • syntax
kubectl run <paramters> <name-of-pod>
  • Example
kubectl run --image httpd web1
  • To view the pods
kubectl get pods
  • To view the pods with more info
kubectl get pods -o wide

Preview

  • To delete the pod
kubectl delete pod <name>

Preview

  • We can create pod and exec into contianer
    Preview

Activity

  • Create two pods
    • web1 => nginx
    • web2 => httpd
  • execute the command whoami
  • delete the pods
  • note: use killercoda

Intro to Writing k8s manifests

  • Manifest in k8s is where we express a desired state in the yaml form.
  • k8s gives an api reference using which writing yaml files is easier Refer Here
  • Watch video

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

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

Please turn AdBlock off
Plugin for Social Media by Acurax Wordpress Design Studio

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube