Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Kubernetes2

228 views

Published on

Introducción a Kubernetes

Published in: Software
  • Be the first to comment

  • Be the first to like this

Kubernetes2

  1. 1. KUBERNETES
  2. 2. “A Cloudy History of Time” 1940 1950 1960 1970 1980 1990 2000 Timesharing Companies & Data Processing Industry Grids Peer to peer systems Clusters The first datacenters! PCs (not distributed!) Clouds and datacenters 2012 2
  3. 3. Today’s talk
  4. 4. VMWare 1998 Xen 2003 HW assisted Virt 2005 EC2 2006 Opennebula Eucalyptus 2008 CloudStack 2010 Openstack 2010 GCE 2012
  5. 5. Goals • Utility computing • Elasticity of the infrastructure • On-demand • Pay as you go • Multi-tenant • Programmable access
  6. 6. So what… • Let’s assume this is solved. • What is not solved: • - Application deployment • - Application scalability • - Application portability • - Application composability
  7. 7. Docker • Linux container (LXC +) • Application deployment • PaaS • Portability • Image sharing via DockerHub • Ease of packaging applications
  8. 8. Building docker images Fair use from http://blog.octo.com/en/docker-registry-first-steps/
  9. 9. Mesos/Marathon Architecture • Apache Mesos is a resource manager and provides a datacenter view of a cluster of machines. • Works in a Master/Slave architecture. • Master schedules job on slaves which is executed by an executor. • Masters are connected to service registry such as Zookeeper for leader election and HA. • Offers resources to any framework connected on top of it. • Marathon is a scheduler/framework providing orchestration capabilities. Mesos Master Assigns jobs to slaves and make resource offers to framework Mesos Slave Runs Mesos agents. Executes tasks and provides resource capacity to master Zookeeper Leader election of Masters Framework Selects and schedules tasks via resource offers. Deploys executors on agents to execute scheduled tasks
  10. 10. Docker Swarm Architecture docker swarm init <<options>> docker swarm join <<options>> • Directly available within Docker engine from docker 1.12. • Enable cluster setup in swarm mode with simple commands • Create services instead of containers. • Managers talk to workers to schedule tasks on the worker. • Managers use Raft algorithm for leader election. • Worker nodes communicate through gossip protocol. • In built support for Service Registry and discovery. • No need for external services like consul, etcd. • In built Load balancing. • Multi host container networking via Overlay networks • Secured by default via TLS. • Automatic reconciliation to desired state of cluster. Master Schedules tasks on slaves and exposes service commands. Slave Executes containers Internal Key Value Store Inbuilt key values store for master leader election using Raft algorithm
  11. 11. CoreOS • Linux distribution • Rolling upgrades • Minimal OS • Docker support • etcd and fleet tools to manage distributed applications based on containers. • Cloud-init support • Systemd units
  12. 12. CoreOS
  13. 13. Similar projects
  14. 14. Starting containers #cloud-config coreos: units: - name: docker.service command: start - name: es.service command: start content: | [Unit] After=docker.service Requires=docker.service Description=starts ElasticSearch container [Service] TimeoutStartSec=0 ExecStartPre=/usr/bin/docker pull dockerfile/elasticsearch ExecStart=/usr/bin/docker run -d -p 9200:9200 -p 9300:9300 dockerfile/elasticsearch
  15. 15. CoreOS Cluster
  16. 16. •- Bare metal cluster •- Public Clouds •- Private Clouds
  17. 17. •“How are you going to manage containers running on multiple Docker Hosts ?”
  18. 18. Docker schedulers • Docker Swarm • Citadel • CoreOS Fleet • Lattice from CF incubator • Clocker (via blueprints) • … • Kubernetes
  19. 19. Opportunity • Experiment with a dedicated cluster for container based applications. • Or use a public cloud one:
  20. 20. Kubernetes • Docker application orchestration • Google GCE, rackspace, Azure providers • Deployable on CoreOS • Container replication • HA services
  21. 21. K8s provides container-centric infrastructure Once specific containers are no longer bound to specific machines/VMs, host-centric infrastructure no longer works • Scheduling: Decide where my containers should run • Lifecycle and health: Keep my containers running despite failures • Scaling: Make sets of containers bigger or smaller • Naming and discovery: Find where my containers are now • Load balancing: Distribute traffic across a set of containers • Storage volumes: Provide data to containers • Logging and monitoring: Track what’s happening with my containers • Debugging and introspection: Enter or attach to containers • Identity and authorization: Control who can do things to my containers 23
  22. 22. K8s API Objects ● API Objects: ○ Abstraction of system state ○ Spec: desired state ○ Status: current state ○ Operations ○ Create/Delete/Update/Get/List ○ Basic Objects: ○ Pod, Volume, Service, Namespace ○ High-level abstractions (controllers): ○ ReplicationSet, StatefulSet, DaemonSet, etc. ● Control Plane: ○ Make cluster’s current state match the desired state apiVersion: v1 kind: Node spec: externalID: "3877693740656810196" podCIDR: 10.100.0.0/24 status: addresses: - address: 10.128.0.2 type: InternalIP - address: 104.198.141.183 type: ExternalIP capacity: cpu: "1" memory: 3794520Ki pods: "110" storage: 16310120Ki conditions: - lastHeartbeatTime: 2017-06-07T02:38:14Z message: RouteController created a route reason: RouteCreated status: "False" API Object Example: Node 24
  23. 23. Cloud (e.g CloudStack based = exoscale, openstack based = cern cloud) coreOS coreOS coreOS K* K* K* Docker container Docker container Docker container API calls to Kubernetes API
  24. 24. Example • EXAMPLE using • MINIKUBE • WORDPRESS • https://github.com/kubernetes/kubernetes/tree/master/examples/m ysql-wordpress-pd

×