Google does containers:
Hello Kubernetes
Steve Wong
Open Source Engineer
@cantbewong
{code} by Dell EMC
presenter
Steve Wong
Open Source Engineer
{code} by Dell EMC
@cantbewong
Vladimir Vivien
Open Source Engineer
{code} by Dell EMC
@VladimirVivien
© Copyright 2017 Dell Inc.3
Open source at Dell EMC
– Contribute to meaningful OSS projects
– Create new thought leading OSS applications
– Drive awareness of OSS opportunities with Dell EMC
product teams
– Participate in relevant community engagement projects
– Act in the interest of building a community
{code} by Dell EMC is a group of passionate open
source engineers and advocates working to build a
community around software-based infrastructure.
Platinum SponsorPlatinum Sponsor
© Copyright 2017 Dell Inc.4
In the beginning: The monolith
Linux
Apache
PHP, Perl,Python
libs
© Copyright 2017 Dell Inc.5
Lift and shift VM to container: Does it work?
Linux
Apache
PHP, Perl,Python
libs
Linux
Apache
PHP, Perl,Python
libs
© Copyright 2017 Dell Inc.6
Containers
Linux
Apache
PHP, Perl,Python
libs libs libs
Linux
Apache
PHP, Perl,Python
libs
© Copyright 2017 Dell Inc.7
Container vs VM
• Faster deploy time
• Simplified dependencies
• Less Work for you:
• Common open
source components
are being published
as containers
• Container images more
compact than OVA’s
• More compact
catalog storage
• Faster network copy
+ deploy
© Copyright 2017 Dell Inc.8
Let’s look at N-tier
© Copyright 2017 Dell Inc.9
Other Containers Advantages
They make managing applications easier
• Speed up software innovation
• Deployments are simple
• Creates portable, shareable
and reusable units of code
and requirements
Code Code and requirements Container
© Copyright 2017 Dell Inc.10
Container workload portability
• Creates portable, shareable
and reusable units of code and
requirements
• Runs in any cloud, including
“bare metal on prem” and “your
laptop”
Code Code and requirements Container
Goal: Write once, run anywhere
© Copyright 2017 Dell Inc.11
But packaging and distributing images is
a small part of deploying micro-services
Discovery
Scaling Security
Monitoring Configuration
SchedulingHealth
Network
© Copyright 2017 Dell Inc.12
• Open source, open API container
orchestrator
• Manage applications, not
machines
• Supports multiple cloud and
bare-metal environments
• Inspired and informed by Google’s
experiences and internal systems
– Over 12 years
– 2B deployed each week
Kubernetes
© Copyright 2017 Dell Inc.13
History
• Kubernetes (Greek for "helmsman" or "pilot")
• Its development and design are heavily influenced by Google’s internal
Borg system and many of the top contributors to the project previously
worked on Borg.
• The original name for Kubernetes within Google was project Seven of
Nine, a reference to a Star Trek character that is a 'friendlier' Borg
– Google's lawyers rejected taking the internal codename public, thus the
Kubernetes name. The seven spokes on the wheel of the Kubernetes logo is
an acknowledgment of the bannished name.
• Kubernetes v1.0 was released on July 21, 2015.
© Copyright 2017 Dell Inc.14
What is Kubernetes?
From a resource perspective:
•It’s a cluster manager
– Pools Computers into a centrally managed resource pool managed
as a unit
From an application perspective
•It’s a scheduler (= dispatcher)
– Dispatches workloads which consume the pooled resources
© Copyright 2017 Dell Inc.15
Kubernetes is based on controller loops
• Drive current state -> desired state
• Act independently
• APIs - no shortcuts or back doors
• Observed state is truth
• Recurring pattern in the system
© Copyright 2017 Dell Inc.16
Child
• Go upstairs
• Get undressed
• Put on pajamas
• Brush your teeth
• Pick out 2 stories
Employee
• Go get some sleep
Desired State: like managing children vs employees
© Copyright 2017 Dell Inc.17
There should be:
3 Frontends
2 Services
1 Backend
Example:
desired state
automation of scale-out
© Copyright 2017 Dell Inc.18
Cattle
• Has a number
• One is much like any other
• Run as a group
• If it gets ill, you make hamburgers
Pet
• Has a name
• Is unique or rare
• Personal Attention
• If it gets ill, you make it better
Cattle vs Pets = Kubernetes can do both
© Copyright 2017 Dell Inc.19
Architecture /Components
© Copyright 2017 Dell Inc.20
Kubernetes Aerial view
users master nodes
© Copyright 2017 Dell Inc.21
• The atom of scheduling for containers
• One or more containers and volumes
• Each has its own routable (no NAT) IP
address
• IP and storage shared across pod
• Emphemeral – gets new ID if killed and
reborn
© Copyright 2017 Dell Inc.22
Deployment/ReplicaSet
• Specify desired number of instances
• Kubernetes monitors health
• Automates driving actual toward desired
© Copyright 2017 Dell Inc.23
The journey to the cloud..
sounds all white and fluffy,
After all, what could possibly
go wrong?
© Copyright 2017 Dell Inc.24
What could possibly go wrong?
– Hardware failure
– Software failure
– File system corruption
– Accidental deletion
© Copyright 2017 Dell Inc.25
Kubernetes controller model
1. Observe 2 instances
2. Declared desired instances is 3
3. Initiate automated deployment of a replacement
© Copyright 2017 Dell Inc.26
Services
• Provide
• Discovery
• Load balancing
• A stable address
(internal or external)
© Copyright 2017 Dell Inc.27
© Copyright 2017 Dell Inc.28
External Persistent Storage
• Pods are ephemeral and stateless
• Volumes bring persistence to Pods
• Kubernetes volumes are similar to
Docker volumes, but managed
differently
• All containers within a pod can
access the volume
© Copyright 2017 Dell Inc.29
External Volume Mount Addresses
• Availability Risk
– Migrate container to another host – your
storage is gone
– Host goes down – your service goes
down
• Scale Limitation
– Need more storage than the host has?
Sorry…
© Copyright 2017 Dell Inc.30
Storage Classes and dynamic provisioning
© Copyright 2017 Dell Inc.31
StatefulSets
• Goal: enable clustered multinode software
on Kubernetes
• MySQL
• PostgreSQL
• Zookeeper
• These need “identity” and sequencing
guarantees
• Stable hostname available in DNS
• Ordinal index for instances
• Stable storage linked to ordinal + hostname
• Discovery of peers
• Startup/Tear down ordering
© Copyright 2017 Dell Inc.32
Storage for Kubernetes Persistent Volumes
• Kubernetes offers two approaches for storage
integration.
– An “in-tree” volume plugin for a platform. The
storage interface code is directly embedded into
Kubernetes. The downside is that plugin velocity
(the speed at which a plugin can be added,
enhanced, or patched) is gated by the Kubernetes
release cycle.
– The second approach is to leverage the
FlexVolume volume plugin. This plugin uses
externally installed and managed software to
handle basic Attach/Detach/Mount/Unmount
storage operations.
© Copyright 2017 Dell Inc.33
Kubernetes Integration
• ScaleIO is part of the core Kubernetes code and a first
class native storage provider
– ScaleIO can take full advantage of the Kubernetes volume
lifecycle features including dynamic provisioning and
storage classes
– ScaleIO driver is embedded in the standard distribution of
Kubernetes
– Contributed code from the {code} by Dell EMC team
passes “Google” standard of quality
– Opens a new opportunity for those running Kubernetes in
on-premise data centers. It allows utilization of your
commodity x86 server hardware for very high performance
and highly available storage for running stateful apps in
containers.
© Copyright 2017 Dell Inc.34
Kubernetes Integration
• REX-Ray provides an adapter script called FlexRex
which integrates with the FlexVolume plug-in to interact
with the backing storage system
– Allows pods to consume data stored on volumes that are
orchestrated by REX-Ray. Using Kubernetes' FlexVolume
plug-in, REX-Ray can provide uniform access to storage
operations such as attach, mount, detach, and unmount for
any configured storage provider.
– Run stateful applications in pods and stateful sets through
FlexREX, and benefit from CLI management capabilities.
– Use any REX-Ray supported storage platform
– Dynamic Provisioning and storage classes are not available
as a limitation of FlexVolume and requires volume
create/delete to be managed outside of Kubernetes
$ rexray flexrex install
© Copyright 2017 Dell Inc.35
Demo!
© Copyright 2017 Dell Inc.36
codedellemc.com
community.codedellemc.com
@codeDellEMC
blog.codedellemc.com
{code} by Dell EMC is a group of
passionate open source engineers and
advocates working to build a community
around software-based infrastructure.
rexray.codedellemc.com
github.com/codedellemc/labs
Steve Wong
@cantbewong
github.com/cantbewong
#codeopen
HOL01 Use REX-Ray & ScaleIO w/ Docker, Mesos and Kubernetes
Google does containers: Hello Kubernetes - Steve Wong and Vladimir Vivien - Dell EMC World 2017

Google does containers: Hello Kubernetes - Steve Wong and Vladimir Vivien - Dell EMC World 2017

  • 1.
    Google does containers: HelloKubernetes Steve Wong Open Source Engineer @cantbewong {code} by Dell EMC
  • 2.
    presenter Steve Wong Open SourceEngineer {code} by Dell EMC @cantbewong Vladimir Vivien Open Source Engineer {code} by Dell EMC @VladimirVivien
  • 3.
    © Copyright 2017Dell Inc.3 Open source at Dell EMC – Contribute to meaningful OSS projects – Create new thought leading OSS applications – Drive awareness of OSS opportunities with Dell EMC product teams – Participate in relevant community engagement projects – Act in the interest of building a community {code} by Dell EMC is a group of passionate open source engineers and advocates working to build a community around software-based infrastructure. Platinum SponsorPlatinum Sponsor
  • 4.
    © Copyright 2017Dell Inc.4 In the beginning: The monolith Linux Apache PHP, Perl,Python libs
  • 5.
    © Copyright 2017Dell Inc.5 Lift and shift VM to container: Does it work? Linux Apache PHP, Perl,Python libs Linux Apache PHP, Perl,Python libs
  • 6.
    © Copyright 2017Dell Inc.6 Containers Linux Apache PHP, Perl,Python libs libs libs Linux Apache PHP, Perl,Python libs
  • 7.
    © Copyright 2017Dell Inc.7 Container vs VM • Faster deploy time • Simplified dependencies • Less Work for you: • Common open source components are being published as containers • Container images more compact than OVA’s • More compact catalog storage • Faster network copy + deploy
  • 8.
    © Copyright 2017Dell Inc.8 Let’s look at N-tier
  • 9.
    © Copyright 2017Dell Inc.9 Other Containers Advantages They make managing applications easier • Speed up software innovation • Deployments are simple • Creates portable, shareable and reusable units of code and requirements Code Code and requirements Container
  • 10.
    © Copyright 2017Dell Inc.10 Container workload portability • Creates portable, shareable and reusable units of code and requirements • Runs in any cloud, including “bare metal on prem” and “your laptop” Code Code and requirements Container Goal: Write once, run anywhere
  • 11.
    © Copyright 2017Dell Inc.11 But packaging and distributing images is a small part of deploying micro-services Discovery Scaling Security Monitoring Configuration SchedulingHealth Network
  • 12.
    © Copyright 2017Dell Inc.12 • Open source, open API container orchestrator • Manage applications, not machines • Supports multiple cloud and bare-metal environments • Inspired and informed by Google’s experiences and internal systems – Over 12 years – 2B deployed each week Kubernetes
  • 13.
    © Copyright 2017Dell Inc.13 History • Kubernetes (Greek for "helmsman" or "pilot") • Its development and design are heavily influenced by Google’s internal Borg system and many of the top contributors to the project previously worked on Borg. • The original name for Kubernetes within Google was project Seven of Nine, a reference to a Star Trek character that is a 'friendlier' Borg – Google's lawyers rejected taking the internal codename public, thus the Kubernetes name. The seven spokes on the wheel of the Kubernetes logo is an acknowledgment of the bannished name. • Kubernetes v1.0 was released on July 21, 2015.
  • 14.
    © Copyright 2017Dell Inc.14 What is Kubernetes? From a resource perspective: •It’s a cluster manager – Pools Computers into a centrally managed resource pool managed as a unit From an application perspective •It’s a scheduler (= dispatcher) – Dispatches workloads which consume the pooled resources
  • 15.
    © Copyright 2017Dell Inc.15 Kubernetes is based on controller loops • Drive current state -> desired state • Act independently • APIs - no shortcuts or back doors • Observed state is truth • Recurring pattern in the system
  • 16.
    © Copyright 2017Dell Inc.16 Child • Go upstairs • Get undressed • Put on pajamas • Brush your teeth • Pick out 2 stories Employee • Go get some sleep Desired State: like managing children vs employees
  • 17.
    © Copyright 2017Dell Inc.17 There should be: 3 Frontends 2 Services 1 Backend Example: desired state automation of scale-out
  • 18.
    © Copyright 2017Dell Inc.18 Cattle • Has a number • One is much like any other • Run as a group • If it gets ill, you make hamburgers Pet • Has a name • Is unique or rare • Personal Attention • If it gets ill, you make it better Cattle vs Pets = Kubernetes can do both
  • 19.
    © Copyright 2017Dell Inc.19 Architecture /Components
  • 20.
    © Copyright 2017Dell Inc.20 Kubernetes Aerial view users master nodes
  • 21.
    © Copyright 2017Dell Inc.21 • The atom of scheduling for containers • One or more containers and volumes • Each has its own routable (no NAT) IP address • IP and storage shared across pod • Emphemeral – gets new ID if killed and reborn
  • 22.
    © Copyright 2017Dell Inc.22 Deployment/ReplicaSet • Specify desired number of instances • Kubernetes monitors health • Automates driving actual toward desired
  • 23.
    © Copyright 2017Dell Inc.23 The journey to the cloud.. sounds all white and fluffy, After all, what could possibly go wrong?
  • 24.
    © Copyright 2017Dell Inc.24 What could possibly go wrong? – Hardware failure – Software failure – File system corruption – Accidental deletion
  • 25.
    © Copyright 2017Dell Inc.25 Kubernetes controller model 1. Observe 2 instances 2. Declared desired instances is 3 3. Initiate automated deployment of a replacement
  • 26.
    © Copyright 2017Dell Inc.26 Services • Provide • Discovery • Load balancing • A stable address (internal or external)
  • 27.
    © Copyright 2017Dell Inc.27
  • 28.
    © Copyright 2017Dell Inc.28 External Persistent Storage • Pods are ephemeral and stateless • Volumes bring persistence to Pods • Kubernetes volumes are similar to Docker volumes, but managed differently • All containers within a pod can access the volume
  • 29.
    © Copyright 2017Dell Inc.29 External Volume Mount Addresses • Availability Risk – Migrate container to another host – your storage is gone – Host goes down – your service goes down • Scale Limitation – Need more storage than the host has? Sorry…
  • 30.
    © Copyright 2017Dell Inc.30 Storage Classes and dynamic provisioning
  • 31.
    © Copyright 2017Dell Inc.31 StatefulSets • Goal: enable clustered multinode software on Kubernetes • MySQL • PostgreSQL • Zookeeper • These need “identity” and sequencing guarantees • Stable hostname available in DNS • Ordinal index for instances • Stable storage linked to ordinal + hostname • Discovery of peers • Startup/Tear down ordering
  • 32.
    © Copyright 2017Dell Inc.32 Storage for Kubernetes Persistent Volumes • Kubernetes offers two approaches for storage integration. – An “in-tree” volume plugin for a platform. The storage interface code is directly embedded into Kubernetes. The downside is that plugin velocity (the speed at which a plugin can be added, enhanced, or patched) is gated by the Kubernetes release cycle. – The second approach is to leverage the FlexVolume volume plugin. This plugin uses externally installed and managed software to handle basic Attach/Detach/Mount/Unmount storage operations.
  • 33.
    © Copyright 2017Dell Inc.33 Kubernetes Integration • ScaleIO is part of the core Kubernetes code and a first class native storage provider – ScaleIO can take full advantage of the Kubernetes volume lifecycle features including dynamic provisioning and storage classes – ScaleIO driver is embedded in the standard distribution of Kubernetes – Contributed code from the {code} by Dell EMC team passes “Google” standard of quality – Opens a new opportunity for those running Kubernetes in on-premise data centers. It allows utilization of your commodity x86 server hardware for very high performance and highly available storage for running stateful apps in containers.
  • 34.
    © Copyright 2017Dell Inc.34 Kubernetes Integration • REX-Ray provides an adapter script called FlexRex which integrates with the FlexVolume plug-in to interact with the backing storage system – Allows pods to consume data stored on volumes that are orchestrated by REX-Ray. Using Kubernetes' FlexVolume plug-in, REX-Ray can provide uniform access to storage operations such as attach, mount, detach, and unmount for any configured storage provider. – Run stateful applications in pods and stateful sets through FlexREX, and benefit from CLI management capabilities. – Use any REX-Ray supported storage platform – Dynamic Provisioning and storage classes are not available as a limitation of FlexVolume and requires volume create/delete to be managed outside of Kubernetes $ rexray flexrex install
  • 35.
    © Copyright 2017Dell Inc.35 Demo!
  • 36.
    © Copyright 2017Dell Inc.36 codedellemc.com community.codedellemc.com @codeDellEMC blog.codedellemc.com {code} by Dell EMC is a group of passionate open source engineers and advocates working to build a community around software-based infrastructure. rexray.codedellemc.com github.com/codedellemc/labs Steve Wong @cantbewong github.com/cantbewong #codeopen HOL01 Use REX-Ray & ScaleIO w/ Docker, Mesos and Kubernetes

Editor's Notes

  • #4 Add talking points to each point OSS projects: Docker, Mesos, Kubernetes, Cloud Foundry
  • #5 Let’s suppose in the not too distant past, we set out to deploy the server half of a client server system. What did this look like? Maybe an assembly of apps like this. Some apps need to talk to each other, some don’t, but the easy way was to put everything on a single host. Result: it works but.. The apps share a bunch of libraries – no isolation If memory runs out, who caused it? Other security and isolation issues
  • #6 Container technology would let you repeat the monolith It doesn’t stop you from recreating history – but containers let you do better…
  • #7 Containers are “lighter weight” than a VM, The OS kernel is shared. Run time images are single app, Bundled with ONLY the libraries needed At VERSION of choice
  • #9 In an N-tier architecture, each layer can be scaled independently. Let’s suppose that the usage pattern for this application exhibits variable load based on time of day, day of week, or discrete occurrences of events. How quickly can we scale out a component is VALUEABLE Small Image size and shared OS kernel makes this work
  • #10 You could use Puppet, Chef, or another DevOps tools to compose VMs, but with a Docker image app dependency list is documented in the Dockerfile specService or App level granularity means updates are flexible, and dev test environments that match production are easier to achieve .
  • #11 AVOID VENDOR LOCK-IN GOAL: Apps not forced to know where they are running To know concepts that are cloud provider specific
  • #12 But WARNING when you do this at scale, use of containers hasn’t solved all the issues – and can even introduce new issues you didn’t have before, or at least didn’t have before at the same scale This is no different from VMs - Managing a data center at scale isn’t feasible without a lot of automation
  • #21 Users (admin+developers) use API or CLI to interact with master This ends up manipulating state in etcd store Scheduler figures out what is available and where to run things Controllers maintain desired state May also talk to network load balancers or storage appliances Kubelets run on every node, listens to and talks to API server to control state on its node
  • #22 Pod should be a small group of closely related containers
  • #27 Pods aren’t meant to be persistent. This means that when they are restarted they can get a new IP address. These leads to a problem that services are meant to solve
  • #29 Shared access across multiple containers: Use if you need to allow multiple containers to read and write to volume. Log volume is a common use case.
  • #31 Administrator defined gold, silver, bronze storage classes Developer/User defines a pod requesting a class of storage for a persistent volume Upon initail deployment, a persistent volume is created automatically for use by the pod
  • #37 First, a few things about the team that has made this possible. The Dell EMC {code} team is a team made up of open source software engineers and developer advocates, focused on making EMC a well-known name within the open source community. We will focus on one of their projects, REX-Ray, in this presentation.