Introduction to Kubernetes
Learning Objectives: Upon completion of this module, you will get to know the difference between a virtual machine and a container, the need for Kubernetes in the world of containerization, and also what Kubernetes is not.
- Docker Essentials
- What is YAML ?
- Basics of YAML
- YAML Structure
- Syntax of YAML
- What is Virtualization?
- What is Containerization?
- Virtualization vs Containerization
- Introduction to Kubernetes
- Myth busters of Kubernetes – What Kubernetes is not?
- Install Virutal Box
- Install Docker/Docker-client
- Write a simple Docker File using YAML format
- Create a Simple docker File for a Node.js Hello World application
- Create a Docker Image using Docker File
- Deploy & Run the Docker Image using Nginx/Apache docker image
Learning Objectives: Upon completion of this module, one will get to know about the key components that build a Kubernetes cluster – Master components, Node components and AddOns. We will also see how to install Kubernetes from scratch on Ubuntu VMs.
- Introduction to Kubernetes Master
- etcd key-value store
- Components of Cloud Controller Manager - Node Controller, Volume Controller, Route Controller, Service Controller
- Introduction to Node Components of Kubernetes
- Add-ons in Kubernetes: Cluster DNS, Kubernetes Dashboard, Container Resource Monitoring, Cluster level logging
- Create 2 Ubuntu(17.10) VM’s in Virtual box
- Create a single-node cluster using VMs
- Install KubeCtl, a command line tool to manage clusters
- Start a single-node cluster locally
- Get cluster details
- List all nodes associated with the cluster
- Stopping a cluster
- Deleting a cluster
- Installing & Accessing the Kubernetes dashboard
Deploy an app to Kubernetes Cluster
Learning Objectives: In this module, you will understand how to deploy an app using Kubectl to the local Kubernetes cluster and why we need a Pod.
- Introduction to Pods
- Why do we need a Pod?
- Pod Lifecycle
- Working with Pods to manage multiple containers
- Pod Preset
- What is a Node?
- kubectl basic commands
- Containerized app deployment on local kubernetes cluster
- GCP (Ephemeral) volumes
- Deploy a containerized app image in the locally setup kubernetes cluster
- List all local deployments
- Create a kubectl proxy for forwarding communication to cluster-wide private network
- Curl to verify that the app is running
- List all existing pods
- Get description of a specific pod
- View logs of the container
- Execute commands directly on the container
- Create a ephemeral volume in GCP.
- Configure Pod to store data in GC Volumes.
Expose App, Scale App And Update App in Kubernetes
Learning Objectives: In this module, you will learn what a service is, how to expose the deployed app outside the Kubernetes cluster, how to scale up/down the replicas of the app and how to provide updates to the app.
- What is a Service?
- Labels and Selectors
- Deployment Controller
- Replica Set
- Replication Controller
- Scaling out a deployment using replicas
- Horizontal pod autoscaler
- Load balancing
- Rolling Update
- Ingress and its types
- Create a new service
- Add ha-proxy to configuration file as proxy to expose the application
- Expose the service outside the cluster using ha-proxy
- List all services
- Get more details of a particular service
- Get more information about a label
- Use labels to query required pods
- Create a new label to the pod
- Scale up the above deployment to 4 replicas
- Scale down the above deployment to 2 replicas
- Update the image of the application
- Check the rollout status
- Rollback an update
- Delete the service created
Managing State with Deployments
Learning Objectives: After this module, you should be able to deploy both stateless applications and stateful applications. You will be able to create a stateful set and a headless service. You will also be able to scale the stateful sets and provide rolling updates.
- Stateful set
- Pod management policies: OrderedReady, Parallel
- Update strategies: OnDelete, Rolling Update
- Cluster DNS
- Headless services
- Persistent Volumes
- Deploy a stateless application – PHP Guestbook application backed up by Redis: Start redis master and slaves, Start the PHP Guestbook, Expose and view the PHP Guestbook, Scale up the PHP Guestbook
- Deploy a stateful application - Deploy Wordpress site backed up by MySQL database: Create PersistentVolume, Create a secret for storing MySQL password, Deploy MySQL, Deploy WordPress, Setup Jenkins in VM using jenkins docker image, Create a pipeline in Jenkins to use *.yml files to deploy & start the application
Federations, Auditing and Debugging Kubernetes, Security Best Practices
Learning Objectives: Once you complete this module, you will be able to use federations in Kubernetes using kubefed. You will also be able to log the events of the Kubernetes cluster and use it to debug nodes and pods. You will get aware of how security can be enforced in the cluster that we create using the best practices.
- Federated clusters
- Debugging by looking at events such as: Pending Pods, Unreachable nodes
- Auditing and accessing logs in Kubernetes – Log collectors and audit policy
- Security best practices in Kubernetes
- Install kubefed
- Deploying a federation control plane
- Add a cluster to the federation
- Remove a cluster from the federation
- Labeling a federated cluster
- The cleanup federation control plane
- Logging and accessing logs in Kubernetes