Docker and Kubernetes

DevOps

Course Outline


Day 1

Environment Setup

  • o  Install Virtual Box / Use AWS / Azure
  • o  Create Ubuntu/CentOS Virtual Machine
  • o  Install SSH on the box
  • o  Connect from Windows through SSH

Docker Basics

  • o  Virtualization and Containerization
  • o  Install git on windows as well as VM
  • o  Docker Architecture
  • o  Docker Image Internals
  • o  Docker Container Internals
  • o  Docker Lifecycle

Lab:

  • § Lab on Docker image
  • § Lab on Docker Hub
  • § Lab on Docker Container
  • § Creating an image from our custom container
  • § Pushing our image to Docker Hub
  • § Export and import images and Containers
  • § Accessing containers from outside the machine.


Day 2

Understanding the internals

  • o  Namespaces.
  • o  Control Groups
  • o  Filesystem
  • § COW
  • o  How are the images stored?
  • § Hands on session
  • o  How are the containers stored?
  • § Hands on session

Build our own Docker image

  • o  Discuss about each of the Dockerfile commands.
  • § Difference between RUN, EntryPoint and Command
  • § Difference between Add and Copy
  • o  Lab:
  • § Create Docker images with:
  • Ø FROM
  • Ø RUN
  • Ø ENTRYPOINT
  • Ø CMD
  • Ø ARG
  • Ø Ect.
  • o  Build a Docker image of an existing small application hosted on Tomcat.


Volume

  • o  What is Volume and why do we need them.
  • o  Different types of Docker volumes
  • § Lab:
  • Ø Create a container attached to
  • ü volume and understand the internals
  • ü Bind mounts and understand the internals
  • Ø Understand the various options
  • ü How to distinguish them
  • ü Which volume type to use? When to use them?
  • o  Lab:
  • § Create Docker web container connected to backend mysql container.
  • § Crash and restore of mysql container.
  • Multi Stage Build


Day 3

Docker Networking

  • o  Understanding networking in general
  • o  Docker networking
  • § Lab:
  • Ø Use the default bridge
  • ü Understand the internals
  • Ø Create a custom bridge
  • ü Understand the internals
  • Ø Understand the difference between default and custom bridge
  • Ø Use the host network
  • ü Understand the internals
  • Ø Use the none network
  • ü Understand the internals

black laptop computer turned on on table

Day 4

Kubernetes

  • o  Introduction to Container Orchestration
  • o  Architecture
  • o  On premises considerations
  • o  Annotations
  • o  Install a three-node cluster (one master and two worker)
  • o  Scheduling, eviction, affinity, taints and tolerations
  • § Lab on scheduling a Pod on a Node.
  • o  Advantages of Kubernetes
  • o  Pods
  • § Labs: Creating our own Pods
  • o  Understanding Pods
  • o  How was the Pod created?
  • § Hands on Deep dive into Pods


Kubernetes Objects

  • Namespaces
  • Lab on Namespaces
  • Labels
  • Lab on Labels
  • Selectors
  • Lab on selectors
  • Annotations
  • Lab on annotations



Kubernetes Pods (Deep Dive)

  • Pod architecture
  • Pod lifecycle
  • Multi-container Pods
  • Sidecar container pattern


Init Containers

  • Initialization workflows

Static Pods

  • Running pods directly via kubelet

Lab

  • Create pods
  • Multi-container pods
  • Init containers

 

Replicas

  • o  Replication Controller
  • o  Replica Set
  • o   Desired state
  • o  Self-healing
  • o  Scaling
  • § Lab:
  • Ø Hands on impact of Replica Set


Day 5

Deployment

  • o  Deployment strategies
  • o  Rolling updates
  • o  Rollbacks
  • o  Deployment history    
  • o  Lab:
  • § Create a deployment
  • § Scale out and scale in
  • § Update and rollback


  • StatefulSet
  • Daemonset
  • Kubernetes Jobs
  • Lab:
  • o  Kubernetes jobs
  • Secretes
  • Lab:
  • o  Kubernetes Secrets


Kubernetes Volumes

  • o  emptyDir
  • o  hostPath
  • o  configMap volumes
  • o  secret volumes

Persistent Storage

  • o  Persistent Volumes (PV)
  • o  Persistent Volume Claims (PVC)
  • o  Storage Classes
  • Lab
  • o  Create PV
  • o  Create PVC
  • o  Mount volumes to pods

·      

ConfigMaps and Secrets

  • o  Managing application configuration
  • o  Environment variables

 

ServiceTypes

  • o  Clust IP
  • § Lab: Cluster IP
  • o  NodePort
  • § Lab: NodePort
  • o  Loadbalancer
  • o  ExternalIP


Day 6

Container Network Interface (CNI)

  • CNI architecture
  • Popular CNI plugins
  • o  Calico
  • o  Flannel
  • o  Weave

Kubernetes Ingress

  • Ingress resources
  • Ingress controllers
  • Path-based routing
  • TLS termination


Network Policies

  • Securing pod communication
  • Allow/Deny traffic

Lab

  • Create services
  • Configure ingress
  • Apply network policies

 

Kubernetes Security

RBAC (Role Based Access Control)

  • Roles
  • RoleBindings
  • ClusterRoles
  • ClusterRoleBindings


Admission Controllers

  • Policy enforcement
  • Security policies


Day 7

 

Advanced Kubernetes and Operations

Kubernetes Jobs

  • Batch jobs
  • CronJobs

Kubernetes Probes                                           

  • Liveness probe
  • Readiness probe
  • Startup probe

Kubernetes Scheduling

  • Scheduler workflow
  • Node affinity
  • Pod affinity
  • Taints and tolerations
  • Resource requests and limits

Kubernetes Scaling

  • Introduction to scaling in Kubernetes
  • Horizontal Pod Autoscaler (HPA)
  • Vertical Pod Autoscaler (VPA)
  • Cluster Autoscaler (CA)
  • Comparison with Karpenter
  • Node provisioning
  • Scaling efficiency


Lab

  • Configure HPA
  • Observe scaling behavior


Day 8

 

Kubernetes Troubleshooting

  • Debugging Pods
  • Logs and events
  • Debugging networking issues
  • Debugging scheduling failures
  • kubectl troubleshooting commands

 

CI/CD

  • o  Implement a complete CI/CD using
  • § Java
  • § Git
  • § Jenkins
  • § Maven
  • § Docker
  • § Junit (Illustrative)
  • § Kubernetes





CONTACT US