SlideShare a Scribd company logo
Kubernetes on
OpenStack
By
Naveen Joy
Cloud Architect
Why Kubernetes?
Provides a higher level abstraction to a lower level docker
interface
Organize applications running in docker containers into
PODs
PODs form the basic unit of operation
POD == set{ one or more containers }
Users declare end state using a POD manifest
Scheduling mechanism for PODs
Containers in a POD are tightly coupled i.e. co-located on a
host and share network namespace, volumes and hostname
Why Kubernetes?
Ability to group PODs using labels
Enable access to the POD group using a service abstraction
(provides a stable service VIP)
The service will keep track of its PODs - endpoints of a service
When traffic hits the service virtual IP, it will be proxied to one of the
backend PODs
POD Management
Restart a failed container in a POD automatically
Self healing - ability to replace PODs when the machine fails
Horizontal scaling
Architecture Overview
Networking Model
Default Networking Model in
Docker
• Host-Private Networking
• Creates a virtual bridge named docker0 on each host
• Allocates a private subnet (e.g. 172.17.0.0/16) from RFC 1918
for that bridge
• Attaches each container to docker0 using a virtual ethernet
device
• Assigns an IP from the private subnet to the container and sets
the bridge IP address is set as the gateway for the container
Default Docker Networking Model
Container reachability across
hosts
Docker may allocate the same IP addresses to containers
across hosts
Containers can talk to each other on the same machine
Containers cannot route traffic directly across hosts using their
private IP address
Containers communicate across hosts by using DNAT
Host IP:Port To Container IP:Port
Default Networking model in
docker can pose issues to
AppsCoordinating static port allocations to containers is very difficult in
practice across multiple developers and groups that share hosts
If using dynamic port allocation, there are still complications
service discovery, application configuration etc.
NAT is hard to troubleshoot
Application running in a container does not know its actual IP address
– so some apps will break
apps that need to register their actual IP address
apps that perform IP based access control/authentication
Networking in Kubernetes
Containers communicate directly over a routed IP network
without using NAT
A container sees the real IP of another container
The host sees the real IP of the container
The default networking model of docker must be modified
for Kubernetes to work
Networking in
Kubernetes
• A routable IP address is assigned per
POD
• All containers within a POD share the
network namespace including the IP
address and port
• Implemented by creating a docker container
for the POD
• This “pod-container” is wired to the POD IP
• All other containers are configured to share
the network stack of the POD container
using the --net=container:<name | id >
function in docker
POD networking
• Each VM is assigned a subnet for
POD networking (Note: This is in
addition to the main neutron subnet
used by the VM)
• The default docker bridge docker0 is
replaced with a linux bridge say “cbr0”
• cbr0 is configured on the POD subnet
• Docker daemon is started with this
bridge using --bridge=cbr0 in its
options
• Docker allocates IPs to the containers
from the POD subnet block
Routing POD Subnets
Option 1:
Create routable POD networks
1. Configure instances to forward IP packets to the bridged POD
network by enabling IP forwarding in the kernel
• sudo sysctl net.ipv4.ip_forward = 1
2. Add static routes on the L3 neutron gateway to route traffic to the
instance
• neutron router-update --routes type=dict list=true 
destination=NODE_X_POD_CIDR, 
nexthop=NODE_X_INTERFACE_IP_ADDR
Routing POD Subnets
Option 1 :
3. When neutron security-groups is enabled, traffic is restricted to/from the
instance IP address by neutron
• Add iptables FORWARD chain rules on the host to allow incoming and
outgoing traffic to/from the POD CIDR
POD_CIDR=10.5.0.0/16
sudo iptables -I FORWARD 1 -p all -s $POD_CIDR –d $POD_CIDR -j ACCEPT
Option 1: Network Diagram
Routing POD Subnets
Option2:
Build an overlay network to route POD networks
• Proceed with caution for production deployment
• These technologies are still in experimental stage
• Creates a layered virtual network architecture
• Create POD virtual network overlay using the neutron virtual
networks as the underlay
• Open source options:
• Flannel, Weave, Calico
Flannel
• Designed for Kubernetes
• Creates a POD subnet on each instance
• Uses etcd to maintain the subnet to real host IP mapping
• Builds an overlay mesh network between instances using UDP
tunneling to connect the subnets
• Requires UDP port 8285 opened in the instance security groups
• Adjust the MTU size for performance
Option 2: Network Diagram
Conclusion
Checkout the Kubernetes github repo
Latest docs
Contains several deployment examples
SaltStack scripts to automate a cluster deployment across
multiple providers

More Related Content

PPTX
Open stackaustinmeetupsept21
PDF
Kubernetes networking in AWS
PDF
Overlay/Underlay - Betting on Container Networking
PPTX
Tectonic Summit 2016: Networking for Kubernetes
PDF
Docker network performance in the public cloud
PDF
Simplifying open stack and kubernetes networking with romana
PPTX
OpenStack Israel Meetup - Project Kuryr: Bringing Container Networking to Neu...
PPTX
OpenStack: Virtual Routers On Compute Nodes
Open stackaustinmeetupsept21
Kubernetes networking in AWS
Overlay/Underlay - Betting on Container Networking
Tectonic Summit 2016: Networking for Kubernetes
Docker network performance in the public cloud
Simplifying open stack and kubernetes networking with romana
OpenStack Israel Meetup - Project Kuryr: Bringing Container Networking to Neu...
OpenStack: Virtual Routers On Compute Nodes

What's hot (20)

PPT
Chapter 02
PDF
An Overview of Linux Networking Options
PDF
Kubernetes networking & Security
PPTX
OpenStack Quantum Network Service
PPTX
OpenStack Quantum
PPTX
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
PPTX
Advanced network services insertions framework
PDF
OpenStack in Action 4! Emilien Macchi & Sylvain Afchain - What's new in neutr...
PDF
Overview of OpenDaylight Container Orchestration Engine Integration
PDF
Quantum - The Network Mechanics
PDF
VPNaaS in Neutron
PPTX
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
PPTX
DevOps Guide to Container Networking
PPTX
Building the Internet of Things with Thingsquare and Contiki - day 1, part 2
PDF
Ryu ods2012-spring
PPTX
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
PDF
Simplifying and Securing your OpenShift Network with Project Calico
PDF
KubeCon London 2016 Ronana Cloud Native SDN
PDF
OpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
PPTX
OpenStack MeetUp - OpenContrail Presentation
Chapter 02
An Overview of Linux Networking Options
Kubernetes networking & Security
OpenStack Quantum Network Service
OpenStack Quantum
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
Advanced network services insertions framework
OpenStack in Action 4! Emilien Macchi & Sylvain Afchain - What's new in neutr...
Overview of OpenDaylight Container Orchestration Engine Integration
Quantum - The Network Mechanics
VPNaaS in Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
DevOps Guide to Container Networking
Building the Internet of Things with Thingsquare and Contiki - day 1, part 2
Ryu ods2012-spring
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Simplifying and Securing your OpenShift Network with Project Calico
KubeCon London 2016 Ronana Cloud Native SDN
OpenStack and OpenContrail for FreeBSD platform by Michał Dubiel
OpenStack MeetUp - OpenContrail Presentation
Ad

Similar to Kubernetes on open stack (20)

PDF
Container network security
PDF
Container Networking Deep Dive
PPTX
KuberNETes - meetup
PPTX
Nynog-K8s-networking-101.pptx
PPTX
Secure Your Containers: What Network Admins Should Know When Moving Into Prod...
PPTX
Container world hybridnetworking_rev2
PDF
Getting Started with Kubernetes
PDF
How to build a Kubernetes networking solution from scratch
PDF
Scaling Microservices with Kubernetes
PDF
Introduction to Kubernetes Workshop
PDF
Kubernetes Networking - Giragadurai Vallirajan
PDF
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
PDF
DevJam 2019 - Introduction to Kubernetes
PDF
99cloud Docker Training module 2
PDF
Lessons learned and challenges faced while running Kubernetes at Scale
PPTX
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
PDF
prodops.io k8s presentation
PDF
Kubernetes From Scratch .pdf
PDF
Kubernetes Networking
PPTX
Introduction to kubernetes
Container network security
Container Networking Deep Dive
KuberNETes - meetup
Nynog-K8s-networking-101.pptx
Secure Your Containers: What Network Admins Should Know When Moving Into Prod...
Container world hybridnetworking_rev2
Getting Started with Kubernetes
How to build a Kubernetes networking solution from scratch
Scaling Microservices with Kubernetes
Introduction to Kubernetes Workshop
Kubernetes Networking - Giragadurai Vallirajan
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
DevJam 2019 - Introduction to Kubernetes
99cloud Docker Training module 2
Lessons learned and challenges faced while running Kubernetes at Scale
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
prodops.io k8s presentation
Kubernetes From Scratch .pdf
Kubernetes Networking
Introduction to kubernetes
Ad

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Big Data Technologies - Introduction.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
Teaching material agriculture food technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Empathic Computing: Creating Shared Understanding
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
DOCX
The AUB Centre for AI in Media Proposal.docx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Spectral efficient network and resource selection model in 5G networks
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Machine learning based COVID-19 study performance prediction
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Big Data Technologies - Introduction.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Building Integrated photovoltaic BIPV_UPV.pdf
Teaching material agriculture food technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Unlocking AI with Model Context Protocol (MCP)
Digital-Transformation-Roadmap-for-Companies.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Empathic Computing: Creating Shared Understanding
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The AUB Centre for AI in Media Proposal.docx

Kubernetes on open stack

  • 2. Why Kubernetes? Provides a higher level abstraction to a lower level docker interface Organize applications running in docker containers into PODs PODs form the basic unit of operation POD == set{ one or more containers } Users declare end state using a POD manifest Scheduling mechanism for PODs Containers in a POD are tightly coupled i.e. co-located on a host and share network namespace, volumes and hostname
  • 3. Why Kubernetes? Ability to group PODs using labels Enable access to the POD group using a service abstraction (provides a stable service VIP) The service will keep track of its PODs - endpoints of a service When traffic hits the service virtual IP, it will be proxied to one of the backend PODs POD Management Restart a failed container in a POD automatically Self healing - ability to replace PODs when the machine fails Horizontal scaling
  • 6. Default Networking Model in Docker • Host-Private Networking • Creates a virtual bridge named docker0 on each host • Allocates a private subnet (e.g. 172.17.0.0/16) from RFC 1918 for that bridge • Attaches each container to docker0 using a virtual ethernet device • Assigns an IP from the private subnet to the container and sets the bridge IP address is set as the gateway for the container
  • 8. Container reachability across hosts Docker may allocate the same IP addresses to containers across hosts Containers can talk to each other on the same machine Containers cannot route traffic directly across hosts using their private IP address Containers communicate across hosts by using DNAT Host IP:Port To Container IP:Port
  • 9. Default Networking model in docker can pose issues to AppsCoordinating static port allocations to containers is very difficult in practice across multiple developers and groups that share hosts If using dynamic port allocation, there are still complications service discovery, application configuration etc. NAT is hard to troubleshoot Application running in a container does not know its actual IP address – so some apps will break apps that need to register their actual IP address apps that perform IP based access control/authentication
  • 10. Networking in Kubernetes Containers communicate directly over a routed IP network without using NAT A container sees the real IP of another container The host sees the real IP of the container The default networking model of docker must be modified for Kubernetes to work
  • 11. Networking in Kubernetes • A routable IP address is assigned per POD • All containers within a POD share the network namespace including the IP address and port • Implemented by creating a docker container for the POD • This “pod-container” is wired to the POD IP • All other containers are configured to share the network stack of the POD container using the --net=container:<name | id > function in docker
  • 12. POD networking • Each VM is assigned a subnet for POD networking (Note: This is in addition to the main neutron subnet used by the VM) • The default docker bridge docker0 is replaced with a linux bridge say “cbr0” • cbr0 is configured on the POD subnet • Docker daemon is started with this bridge using --bridge=cbr0 in its options • Docker allocates IPs to the containers from the POD subnet block
  • 13. Routing POD Subnets Option 1: Create routable POD networks 1. Configure instances to forward IP packets to the bridged POD network by enabling IP forwarding in the kernel • sudo sysctl net.ipv4.ip_forward = 1 2. Add static routes on the L3 neutron gateway to route traffic to the instance • neutron router-update --routes type=dict list=true destination=NODE_X_POD_CIDR, nexthop=NODE_X_INTERFACE_IP_ADDR
  • 14. Routing POD Subnets Option 1 : 3. When neutron security-groups is enabled, traffic is restricted to/from the instance IP address by neutron • Add iptables FORWARD chain rules on the host to allow incoming and outgoing traffic to/from the POD CIDR POD_CIDR=10.5.0.0/16 sudo iptables -I FORWARD 1 -p all -s $POD_CIDR –d $POD_CIDR -j ACCEPT
  • 15. Option 1: Network Diagram
  • 16. Routing POD Subnets Option2: Build an overlay network to route POD networks • Proceed with caution for production deployment • These technologies are still in experimental stage • Creates a layered virtual network architecture • Create POD virtual network overlay using the neutron virtual networks as the underlay • Open source options: • Flannel, Weave, Calico
  • 17. Flannel • Designed for Kubernetes • Creates a POD subnet on each instance • Uses etcd to maintain the subnet to real host IP mapping • Builds an overlay mesh network between instances using UDP tunneling to connect the subnets • Requires UDP port 8285 opened in the instance security groups • Adjust the MTU size for performance
  • 18. Option 2: Network Diagram
  • 19. Conclusion Checkout the Kubernetes github repo Latest docs Contains several deployment examples SaltStack scripts to automate a cluster deployment across multiple providers

Editor's Notes

  • #3: End State: Describe the containers and state that you want them running. If the containers stop for some reason, say – program fails. Kubernetes will re-create the containers to attain the desired state. This process will continue until the POD is deleted. Example of a POD: A set of containers supporting a content management system – containers that run web server (presentation layer), file loading, data loading, cache management In kubernetes, the basic unit of operation is a POD, which means you deploy the set of containers, replicate them, scale, delete. Hostname for apps running in a POD = name of the POD Kubernetes has a control layer that monitors the state and make sure that the current state == end state The service keeps track of the PODs
  • #10: End result : High friction porting of Apps from VMs to Containers
  • #12: Within a POD you coordinate the port usage