containers kuberenetes

17
Containers and Kubernetes Gayan Gunarathne Technical Lead - WSO2 Committer & PMC Member, Apache Stratos

Upload: gayan-gunarathne

Post on 13-Apr-2017

126 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Containers kuberenetes

Containers and Kubernetes

Gayan GunarathneTechnical Lead - WSO2Committer & PMC Member, Apache Stratos

Page 2: Containers kuberenetes

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

Page 3: Containers kuberenetes

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

Page 4: Containers kuberenetes

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

Page 5: Containers kuberenetes

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)

Page 6: Containers kuberenetes

Virtual machine vs Docker

Page 7: Containers kuberenetes

Docker Architecture

Page 8: Containers kuberenetes

Why Kubernetes?

Running a server cluster on a set of Docker containers, on a single Docker host is vulnerable to single point

of failure!

Page 9: Containers kuberenetes

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

Page 10: Containers kuberenetes
Page 11: Containers kuberenetes

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.

Page 12: Containers kuberenetes

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

Page 13: Containers kuberenetes

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.

Page 14: Containers kuberenetes

Kubernetes Architecture

Page 15: Containers kuberenetes

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

Page 16: Containers kuberenetes

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

Page 17: Containers kuberenetes

Q&A