Recent momentum around the evolution of Containers are gradually increase in last two years.Containers virtualize an OS and applications running in each container believe that they have full access to their very own copy of that OS. This is analogous to what VMs do when they virtualize at a lower level, the hardware. In the case of containers, it’s the OS that does the virtualization and maintains the illusion.
Recent past many software companies have quickly adopted container technologies, including Docker Containers, aware of the threat and advantage of the approach. For example, Linux companies have also jumped into the ground, seeing as this as an opportunity to grow the Linux market. Also Microsoft is going to add features to support containers and VMware have made efforts in integrating support for Docker into virtual machine technology.
2. Agenda
● Hypervisors and Virtual Machines
● Containers
● Why containers
● Docker
● Virtual machine vs docker
● Why Kubernetes
● Components of Kubernetes
● Kubernetes Architecture
● How to deploy the service with Kubernetes
3. Hypervisors and Virtual Machines
Hypervisor-Type 1 Hypervisor -Type 2
This is also known as Bare Metal or Embedded or Native
Hypervisor.
It works directly on the hardware of the host and can monitor
operating systems that run above the hypervisor.
Eg:
VMware ESXi Server
Microsoft Hyper-V
Citrix/Xen Server
This is also known as Hosted Hypervisor.
In this case, the hypervisor is installed on an operating system and
then supports other operating systems above it.
It is completely dependent on host Operating System for its operations
Eg:
VMware Workstation
Microsoft Virtual PC
Oracle Virtual Box
4. Why Containers?
Containers resolve some of the problems typically associated with hypervisors and virtual
machines
● Better performance
● Faster provisioning of resources
● Quicker availability of new application instances
● Simple deployment
● Rapid availability
● Leverage microservices
● Recently popularized by Docker
5. Docker
● A platform for managing Linux Containers
● Began as an open-source implementation of the deployment engine which powers dotCloud
● Started in March, 2013
● Provided an easy to use API and powerful container image management features
● Attracted the community very fast
● cgroup and namespacing capabilities of the Linux kernel
● Go programming language (written in Go)
● Docker Image Specification(for container image management)
● Libcontainer Specification (namespaces, filesystem, resources, security, etc)
8. Why Kubernetes?
Running a server cluster on a set of Docker containers, on a single Docker host is vulnerable to single point
of failure!
9. Kubernetes
Open source solution for managing a cluster of containers
Provides container grouping, load balancing, scaling features and self healing
Inspired by the technology that drives Google
Runs anywhere:
○ Public Cloud
○ Private Cloud
○ Bare Metal
10.
11. Master Server Components
The controlling unit in a Kubernetes cluster is called the master server.
Etcd
Developed by the CoreOS team.
It is a lightweight, distributed key-value store that can be distributed across multiple nodes.
API Server
This is the main management point of the entire cluster
Iit allows a user to configure many of Kubernetes' workloads and organizational units.
It also is responsible for making sure that the etcd store and the service details of deployed containers are in agreement.
Controller Manager Server
Handle the replication processes defined by replication tasks
Scheduler Server
Tracking resource utilization on each host to make sure that workloads are not scheduled in excess of the available
12. Minion Server Components
Kubelet Service
Main contact point for each minion with the cluster group
Relaying information to and from the master server, as well as interacting with the etcd store to read
configuration details or write new values.
Proxy Service
Deal with individual host subnetting and in order to make services available to external parties
A small proxy service is run on each minion server
13. Kubernetes Work Units
Pods
A pod generally represents one or more containers that should be controlled as a single "application".
Closely related containers are grouped together in a pod.
Services
Unit that acts as a basic load balancer and ambassador for other containers.
Replication Controllers
Is a framework for defining pods that are meant to be horizontally scaled.
Labels
Arbitrary tag that can be placed on the above work units to mark them as a part of a group.
These can then be selected for management purposes and action targeting.
15. How to deploy the service with Kubernetes
1. First to set up the Kubernetes cluster
EC2- https://cwiki.apache.org/confluence/display/STRATOS/4.1.x+Install+Stratos+with+Kubernetes+on+EC2
2. Sample yaml file for the pod
3. Create a pod.
kubectl create -f pod.yaml
4. Sample service yaml file for the service to expose the your server
5. Create a service
kubectl create -f your-service.yaml
Samples available at
https://github.com/gayangunarathne/KubenetesMysqlServer