RUNNING AND MANAGING
KUBERNETES ON OPENSTACK
Victor Palma – Systems Architect
TONIGHT’S AGENDA
OpenStack + KUBERNETES?
What OpenStack components
are used to deploy kubernetes?
How do I deploy kubernetes on
OpenStack?
Application Deployment Patterns
on kubernetes
SOMETIMES YOU CAN’T START FROM
SCRATCH!
3
NOT BORN IN THE CLOUD!
• UI Layer
• Business Logic Tier
Data
Access Tier
Integration
Tier
MainframeRDMS
DB(s)
• Monolithic Apps
• Dependent on Heavy, stagnant tech
• Configuration is embedded and static
• Requires specific infrastructure and configuration
• Inability to decompose deployments
• Lack of portability
WHAT ABOUT CLOUD NATIVE APPS?
5
Definitions Examples
6
CLOUD NATIVE APPLICATIONS
• Cloud Native
▸ An approach to building
and running applications
that take advantages of the
cloud computing model.
• 12 Factor App
CLOUD NATIVE APPS LITTLE DIRTY SECRET
7
9
• In July 2010, Rackspace Hosting and NASA jointly launched an open-source cloud-software initiative
known as OpenStack. The OpenStack project intended to help organizations offer cloud-computing
services running on standard hardware. The community's first official release, code-named Austin,
appeared three months later on October 21, 2010, with plans to release regular updates of the software
every few months. The early code came from NASA's Nebula platform as well as from Rackspace’s
Cloud Files Platform.
• As of today it’s managed by the OpenStack Foundation, a non-profit corporate entity established in
September 2012 to promote OpenStack software and it’s community. More than 500 companies have
joined the project.
BRIEF OPENSTACK HISTORY
OpenStack is Built on top of Multiple Open Source Projects
11
OPENSTACK PROJECTS
• Core Services:
▸ NOVA – Compute
▸ NEUTRON – Networking
▸ SWIFT – Object Storage
▸ CINDER – Block Storage
▸ KEYSTONE – Identity
▸ GLANCE – Imaging Service
•Optional Services:
▸Horizon – Dashboard
▸Ceilometer – Telemetry
▸Heat – Orchestration
▸Trove – Database
▸Sahara – Elastic Map Reduce
▸Ironic – Bare-Metal Provisioning
▸Zaqar – Messaging Service
▸Manila – Shared FS
▸Designate – DNS Service
▸Barbican – Key Management
▸Magnum – Containers
▸Murano – App Catalog
▸Congress - Governance
Core and Optional Services
IMAGE PLACEHOLDER
1920 X1080
12
WHAT’S THE BIG DEAL
WITH CONTAINERS?
CONTAINERS SIMPLIFY IT
• All required runtime components packaged
together into a “container”
• Eliminates the need for hypervisor & guest OS
• Increases portability across environments
• Reduces resource consumption by applications
• Provision applications nearly instantly
BENEFITS TO ENTERPRISE IT
INCREASE
DEVELOPER
PRODUCTIVITY
INCREASE
TOPLINE
REVENUE
REDUCE DATA
CENTER COSTS
“GETTING” CONTAINERS IS ONLY
HALF THE CHALLENGE
ORGANIZATIONS
STILL NEED TO
MANAGE THEM, JUST
AS THEY WOULD
MANAGE VMS
EXTERNAL RESEARCH
VALIDATES PAIN
POINTS
Container Scale
and Management
Top Container
Challenges
Source; https://www.cloudfoundry.org/wp-content/uploads/2016/06/Cloud-Foundry-2016-Container-Report.pdf n=374
82% of container users surveyed
agreed getting to scale can be
a challenge
84% of container users surveyed
agreed that managing without a
Provider would be a challenge.
MULTIPLE OPTIONS ARE AVAILABLE
Kubernetes Docker Swarm Apache Mesos
Web Search Interest
KUBERNETES IS THE CLEAR LEADER
Source: Apprenda, Containers Orchestration Comparison Guide (PDF)
• Generates more web search
interest than Swarm, Mesos and
Cloud Foundry combined
• One of the top Github projects
• More software vendors incorporate
Kubernetes than any other COE
• More professionals list Kubernetes
on their LinkedIn profiles than any
other comparable solution
WHY KUBERNETES?
• Kubernetes is the market choice for container orchestration
• No lock-in with Kubernetes
• Best-in-class application lifecycle management
§ Blue/green deployments
§ Zero downtime application upgrades
§ A/B deployments and more
• Google and Redhat, and others are focused on standards such
as OCI, CNF (cloud native foundation)
• Kubernetes manages things such as:
‣ Rolling upgrades
‣ Zero Downtime deployment
‣ Large scale management of complex workloads
‣ Highly available and fault tolerant by default
GETTING STARTED
WHY RUN KUBERNETES ON OPENSTACK?
21
INSTALLATION
• Manual
• Orchestration
• Magnum
The Hard way
MANUAL INSTALLATION
24
• Pros
‣ Optimized for learning
‣ Understand how things work
• Cons
‣ Manual
‣ Not meant for production
‣ Hard to maintain
Pros Cons
via Ansible https://github.com/kubernetes/contrib/tree/master/ansible
25
ORCHESTRATION
• Automated
• Easy to install
• Easy to Modify
• Common Configuration
Management
• Limited by what’s
available
PROS CONS
26
MAGNUM
• AUTOMATIC SETUP OF
K8’S CLUSTERS
• YOU CAN EASILY GROW
OR SHRINK THE CLOUD
• EASY TO TEST AND PLAY
WITH KUBERNETES
• OPENSTACK SPECIFIC
KUBERNETES
(SHORT INTRODUCTION)
KUBERNETES
HISTORY
• Borg, Omega and the Origin
of Kubernetes
• The name Kubernetes
originates from Greek,
meaning "helmsman" or
"pilot", and is the root of
"governor" and "cybernetic".
• K8s is an abbreviation
derived by replacing the 8
letters "ubernete" with 8.
WHAT IS
KUBERNETES?
• Kubernetes is an open-source platform
for automating deployment, scaling,
and operations of application
containers across clusters of hosts,
providing container-centric
infrastructure.
• portable: public, private, hybrid, multi-
cloud
• extensible: modular, pluggable,
hookable, compassable
• self-healing: auto-placement, auto-
restart, auto- replication, auto-scaling
ARCHITECTURE
31
Registry
Kubernetes
Master
Node 1
Node 2
Node 3
Node 4
API
UI
CLI
MASTER COMPONENTS
32
API
UI
CLI
etcd
API Server Scheduler Controller
NODE COMPONENTS
33
Kubernetes
Master
Docker kubelet
Daemon sets
Kube-proxy
fluentd
Pod
Pod
PodAddons
Pod Pod
Pod
Pod
Pod
Pod
UIDNS
Node
10K VIEW
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/DESIGN.md34
PODS
• Group of one or more containers that
are always co-located, co-scheduled,
and run in a shared context
• Containers in the same pod have the
same hostname
• Each pod is isolated by
‣ Process ID (PID) namespace
‣ Network namespace
‣ Interprocess Communication (IPC)
namespace
‣ Unix Time Sharing (UTS) namespace
• Alternative to a VM with multiple
processes
LABELS &
SELECTORS
• Key/value pairs associated with
Kubernetes objects
• Used to organize and select subsets of
objects
• Attached to objects at creation time but
modified at any time.
• Labels are the essential glue to
associate one API object with other
‣ Replication Controller -> Pods
‣ Service -> Pods
‣ Pods -> Nodes
REPLICATION
CONTROLLERS
• Ensures that a speci ed number
of pod replicas are running at
any one time.
• allows for easy scaling of
replicated systems and handles
re- creation of a pod when the
machine it is on reboots or
otherwise fails
PUTTING EVERYTHING TOGETHER
38
@meteatamel
DAEMON SETS
• This is a way to run a
pod on every node
JOBS
• Run to complete as opposed to
run for ever
• Built for batch jobs and big-data
CONFIG MAPS
• Ment to handle app
configuration
• Manage congi via the
kubernetes API
• Late binding
• Live-udated
• Available as env vars
SECRETS
• grant a pod access to a
secured something
• Don’t put secrets on your
containers image
QUICK COMMAND LIST
• Cluster Information
• List nodes
• List pods
• List services
• List deployments
kubectl cluster-info
CLUSTER INFORMATION
44
kubectl get nodes | kubectl get no
LIST NODES
45
kubectl get pods | kubectl get po
LISTS PODS
46
kubectl get services | kubectl get svc
LIST SERVICES
47
kubectl get deployments | kubectl get dep
LIST DEPLOYMENTS
48
APPLICATION
DEPLOYMENT PATTERNS
Single-node multi-container patterns
SIDECAR
50
Application
Log
Streaming
Sidecar
LOGS
Log
aggregation
service
POD
@brendandburns
Single-node multi-container patterns
AMBASADOR
51
Application
Memcache
Sharding
Proxy
Memcache
Shard
Memcache
Shard
@brendandburns
Single-node multi-container patterns
ADAPTER
52
Application
Monitoring
Adapter
Centralized
monitoring
service
@brendandburns
Distributed Container Patterns
LEADER ELECTION
53
Application
Reusable
master
election
container
Pod - 1
JSON
API
Pod - 2 Pod - N
Consensus
algorithm
or store
@brendandburns
Distributed Container Patterns
WORK QUEUE
54
Work
Queue
Executor
User
Supplied
worder
JSON
API
Work
Queue
Executor
User
Supplied
worder
JSON
API
* * *
Work
Queue
Coordinator
@brendandburns
Distributed Container Patterns
SCATTER/GATHER
55
@brendandburns
Distributed Container Patterns
SCATTER/GATHER
56
@brendandburns
Distributed Container Patterns
SCATTER/GATHER
57
@brendandburns
Distributed Container Patterns
SCATTER/GATHER
58
@brendandburns
Distributed Container Patterns
SCATTER/GATHER
59
@brendandburns
RACKSPACE OFFERS MANAGED
KUBERNETES FOR ENTERPRISE IT
• Application templates
• Optimized for cost efficiency
• Best-in-class compute
• Kubernetes expertise from certified cloud
specialists
• Centralized logging and monitoring
• Upgrades and patching
• Isolated multi-tenant or single tenant
• Security-hardened environments
• Full turn-key solution with 1-click deployment
• End-to-end tutorials and video training
• Native access to Kubernetes/Docker ecosystems
• Unified GUI and tooling
• Delivered via OpenStack
• Integrated networking
• User management, identity, quotas and limits
• Integrated storage
Operating Expertise Ease of Use
Management Technology Integration
Rackspace
Managed
Kubernetes
60
Fully Managed Kubernetes: Secure and highly performant with an intuitive user experience
BETA AVAILABLE NOW!
Copyright © 2016 Rackspace | Rackspace® Fanatical Support® and other Rackspace marks are either registered service marks or service marks of Rackspace US, Inc. in the United States and other countries. Features, benefits and pricing
presented depend on system configuration and are subject to change without notice. Rackspace disclaims any representation, warranty or other legal commitment regarding its services except for those expressly stated
in a Rackspace services agreement. All other trademarks, service marks, images, products and brands remain the sole property of their respective holders and do not imply endorsement or sponsorship.
THANK YOU
ONE FANATICAL PLACE | SAN ANTONIO, TX 78218
US SALES: 1-800-961-2888 | US SUPPORT: 1-800-961-4454 | WWW.RACKSPACE.COM
References
• http://blog.kubernetes.io/2016/06/container-design-patterns.html
• http://dl.acm.org/citation.cfm?id=3027059
• https://kubernetes.io/docs/home/

Running and Managing Kubernetes on OpenStack