containers kuberenetes
TRANSCRIPT
Containers and Kubernetes
Gayan GunarathneTechnical Lead - WSO2Committer & PMC Member, Apache Stratos
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
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 ServerMicrosoft Hyper-VCitrix/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 WorkstationMicrosoft Virtual PCOracle Virtual Box
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
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)
Virtual machine vs Docker
Docker Architecture
Why Kubernetes?
Running a server cluster on a set of Docker containers, on a single Docker host is vulnerable to single point
of failure!
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
Master Server ComponentsThe 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 ServerTracking resource utilization on each host to make sure that workloads are not scheduled in excess of the available
resources.
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 ServiceDeal with individual host subnetting and in order to make services available to external parties
A small proxy service is run on each minion server
Kubernetes Work UnitsPods
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.
LabelsArbitrary 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.
Kubernetes Architecture
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
References
1. http://en.wikipedia.org/wiki/Hypervisor
2. http://en.wikipedia.org/wiki/LXC
3. https://www.docker.com/
4. https://en.wikipedia.org/wiki/Docker_(software)
5. http://kubernetes.io/
6. http://www.severalnines.com/blog/installing-kubernetes-cluster-minions-centos7-manage-pods-services
7. https://cloud.google.com/container-engine/docs
8. http://fabric8.io/guide
Q&A