SlideShare a Scribd company logo
1 of 26
Download to read offline
Linux Container Technology
inside Docker with RHEL7
Etsuji Nakai
Senior Solution Architect
and Cloud Evangelist
Red Hat K.K
v1.1 2015/08/28
2
Linux Container Technology inside Docker with RHEL7
$ who am i
 中井悦司 / Etsuji Nakai
– Twitter @enakai00
– Senior Solution Architect and
Cloud Evangelist at Red Hat.
– The author of Linux and OpenStack books.
3
Linux Container Technology inside Docker with RHEL7
Contents
 What is Docker?
 Container Technology inside Docker
 Architecture of Kubernetes
 References
What is Docker?
5
Linux Container Technology inside Docker with RHEL7
Quick Demo!
6
Linux Container Technology inside Docker with RHEL7
Dockerfile
① Auto-build Docker images
OS Image
Application
Library / Framework
Application Binary
Describe steps
to build an image
Docker
image
Everything you need to run application
is included in the image
② Upload and publish images
③ Download and run
What you can do with Docker
Container Technology
inside Docker
8
Linux Container Technology inside Docker with RHEL7
 "Linux Container" is a Linux kernel feature to contain a group of processes in
an independent execution environment.
 Linux kernel provides an independent application execution environment for
each container including:
– Independent filesystem.
– Independent network interface and IP address.
– Usage limit for memory and CPU time.
Linux Kernel
UserProcess
・・・
Physical Host / VM
Physical Host / VM
OS
ContainerNo Container
UserProcess
UserProcess
User Space
Linux Kernel
UserProcess
UserProcess
User Space
UserProcess
UserProcess
User Space
・・・
What is container technology?
Container
9
Linux Container Technology inside Docker with RHEL7
 Container supports separation of various resources. They are internally
realized with different technologies called "namespace."
– Filesystem separation  → Mount namespace (kernel 2.4.19)
– Hostname separation → UTS namespace (kernel 2.6.19)
– IPC separation → IPC namespace (kernel 2.6.19)
– User (UID/GID) separation → User namespace (kernel 2.6.23〜kernel 3.8)
– Processtable separation  → PID namespace (kernel 2.6.24) 
– Network separation    → Network Namespace (kernel 2.6.24)
– Usage limit of CPU/Memory → Control groups
 Linux container is realized with integrating these namespace features. There
are multiple container management tools such as lxctools, libvirt and docker.
They may use different parts of these features.
Under the hood
10
Linux Container Technology inside Docker with RHEL7
Filesystem
 A specific directory on the host is bind mounted as a root directory of the container.
Inside container, that directory is seen as a root directory, very similar mechanism to
the "chroot jail."
 When using traditional container management tools such as lxctools or libvirt, you need
to prepare the directory contents by hand.
– You can put minimum contents for a specific application such as application binaries
and shared libraries in the directory.
– It's also possible to copy a whole root filesystem of a specific linux distribution to
the directory.
– If necessary, special filesystems such as /dev, /proc and /sys are mounted in the
container by the management tool.
Mount namespace
/
|--etc
|--bin
|--sbin
...
/export/container01/rootfs/
|--etc
|--bin
|--sbin
...
bind mount
11
Linux Container Technology inside Docker with RHEL7
Filesystem
Container
Application
Directory Tree
Mounted on the host
Assign as / filesystem
 With Docker, you don't need to prepare
the directory tree by hand.
 Docker image is mounted on the host and
used as root filesystem of the container.
Docker Image
12
Linux Container Technology inside Docker with RHEL7
 Processes in all containers are executed on the same Linux kernel. But, inside a
container, you can see processes only in the container.
– This is because each container has its own process table. On host linux, which is outside
containers, you can see all processes including ones in containers.
Process table
# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 09:49 ? 00:00:00 /bin/sh /usr/local/bin/init.sh
root 47 1 0 09:49 ? 00:00:00 /usr/sbin/httpd
apache 49 47 0 09:49 ? 00:00:00 /usr/sbin/httpd
apache 50 47 0 09:49 ? 00:00:00 /usr/sbin/httpd
...
apache 56 47 0 09:49 ? 00:00:00 /usr/sbin/httpd
root 57 1 0 09:49 ? 00:00:00 /bin/bash
# ps -ef
UID PID PPID C STIME TTY TIME CMD
...
root 802 1 0 18:10 ? 00:01:20 /usr/bin/docker -d --selinux-enabled -H fd://
...
root 3687 802 0 18:49 pts/2 00:00:00 /bin/sh /usr/local/bin/init.sh
root 3748 3687 0 18:49 ? 00:00:00 /usr/sbin/httpd
48 3750 3748 0 18:49 ? 00:00:00 /usr/sbin/httpd
...
48 3757 3748 0 18:49 ? 00:00:00 /usr/sbin/httpd
root 3758 3687 0 18:49 pts/2 00:00:00 /bin/bash
Processes seen inside container
Processes seen outside container
13
Linux Container Technology inside Docker with RHEL7
Process table
fork/exec
PID namespace
 In the example of previous page, docker daemon fork/exec-ed the initial
process "init.sh" and put it in a new "PID namespace." After that, all processes
fork/exec-ed from init.sh are put in the same namespace.
 Inside container, the initial process has PID=1 independently from the host.
Likewise, child processes of it have independent PID's.
PID=1
bash
/bin/sh /usr/local/bin/init.sh
httpd
httpd
・・・
#!/bin/sh
service httpd start
while [[ true ]]; do
/bin/bash
done
init.sh
docker daemon
14
Linux Container Technology inside Docker with RHEL7
Network namespace
Network
 Container uses Linux's "veth" device for network communication.
– veth is a pair of logical NIC devices connected through a (virtual) crossover cable.
 One side of the veth pair is placed in a container's network namespace so that it can be
seen only inside the container. The other side is connected to a Linux bridge on the host.
– A device name in the container is renamed such as "eth0." By means of the namespace, network
settings such as IP address, routing table and iptables are independently configured in the
container.
– The connection between the bridge and a physical network is up to the host configuration.
Host Linux
vethXX
eth0
docker0
eth0
Physical network
 Docker creates a bridge "docker0" as a connection point
of container's network.
– Packets from containers are forwarded with IP masquerade.
– Packets from the physical network targeted to specified
ports are forwarded to the container using the port
forwarding feature of iptables.
172.17.42.1# docker run -it -p 8000:80 ...
Accessing to
the external IP
of the host
TCP 8000
TCP 80
Port
forwarding
15
Linux Container Technology inside Docker with RHEL7
Network
 Example container network for 3-tier application running on the same host.
Accessing to the external IP
of the host
Container:Web Server
REST_PORT_5555_TCP_ADDR
eth0
DB_PORT_3306_TCP_ADDR
Container:App Server
eth0
Container:Database
eth0
Linux bridge(docker0)
External IP
Port 80 Port 5555 Port 3306
Port 80
16
Linux Container Technology inside Docker with RHEL7
Network
 Example container network for 3-tier application running on different hosts.
REST_PORT_5555_TCP_ADDR
eth0
External IP
REST_PORT_5555_TCP_ADDR
eth0
External IP
eth0
External IP
Container:Web Server Container:App Server Container:Database
Port 80 Port 5555 Port 3306
Architecture of Kubernetes
18
Linux Container Technology inside Docker with RHEL7
Server configuration
etcd
・・・
Backend Database(KVS)
Kubernetes Master
Kubernetes Node
・・・
Scale-out cluster
Docker Docker Docker
Add more nodes
if necessary.
Docker Registry
 Kubernetes manages multiple nodes from a single master.
– Clustering of multiple masters is not available now. You may use active-standby
configuration with standard HA tools for high availability.
– etcd (KVS) is used as a backend database. It can be configured as a scale-out cluster.
19
Linux Container Technology inside Docker with RHEL7
Network configuration
etcd Kubernetes
Master
Docker
Registry
Configured as
an overlay network.
・・・
 Physical network is simple. Kubernetes works just by connecting all servers to a single
service network.
 However, you need to create an internal network for container communication using an
overlay network.
– You may use Flannel, Open vSwitch, etc. as an overlay technology.
Service network
192.168.122.0/24
Node
docker0
Node
docker0
Internal network
10.1.0.0/16
20
Linux Container Technology inside Docker with RHEL7
External access
etcd Kubernetes
Master
Node
Docker
Registry
Node
API requests Image upload
・・・
Service access
 There are following cases for the external access.
– API requests are sent to the master.
– Services running on containers are accessed from nodes' external IPs via proxy
mechanism.
– Docker registry is an independent component from Kubernetes. You may use a
registry server running on a container.
Service network
Internal network
21
Linux Container Technology inside Docker with RHEL7
Service
 You need to define a service so that you can access the containers inside pods. An
private and (optionally public) IP is assigned to each service.
– You define a single service which aggregates the multiple pods running the same
image. Access to the "IP + port" associated to a service is transferred to the
backend pods with the round-robin manner.
 When defining a service, you need to explicitly specify a port number. A "private IP" is
automatically assigned. The private IP is used for accessing from other pods (not
external uses.)
– Access to the private IP is received by the proxy daemon running on the local node,
and transferred to the backend pods.
– When launching a new pod, the private IPs and ports of existing services are set in
the environment variables inside new containers.
Pod
ProxyThe local proxy daemon
receives the packets to
the private IP.
Pod
Proxy
Round-robin access via
the internal network.
Pod
Proxy
Node Node Node
22
Linux Container Technology inside Docker with RHEL7
Node
External access to services
Service access
 You can specify multiple public IPs for each service.
– By that, external users can access the service via multiple nodes so that a specific
node does not become a SPOF.
– External mechanism to select/load balance multiple nodes is required. Typically, you
can use the DNS load balancing.
Pod
Proxy
The proxy daemon receives
packets to service ports.
Accessing to the
nodes' public IPs.
Node
Pod
Proxy
Round-robin access via
the internal network.
 When defining a service, you need to specify
"Public IPs" if you need to make it accessible
from external users.
– Public IPs' correspond to nodes' IP addresses
from which external uses can access the
service.
– The packets to the corresponding nodes (for
the service port) are received by the proxy
daemon, and transferred to the backend pods.
23
Linux Container Technology inside Docker with RHEL7
Baremetal / VM ・・・
Docker
Baremetal / VM
Docker
Kubernetes
Platform as a Service
・・・
Execution Resource
Container
Management
Container
Orchestration
UI, Monitoring,
Image build workflow,
etc.
RHEL
Atomic Host
OpenShift 3.0
Beyond Kubernetes: OpenShift v3
Container
Container
Container
Container
・・・ ・・・
References
25
Linux Container Technology inside Docker with RHEL7
References
 Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
– http://www.slideshare.net/enakai/architecture-overview-rubbernecks-with-red-
hat-enterprise-linux-71
 Inside Docker for Fedora20/RHEL7
– http://www.slideshare.net/enakai/docker-technology-v18e
 OpenShift 3 Technical Architecture
– https://docs.google.com/presentation/d/1Isp5UeQZTo3gh6e59FMYmMs_V9QIQeBel
mbyHIJ1H_g/pub
 OpenShift v3 Internal networking details
– http://www.slideshare.net/enakai/openshift-45465283
EMPOWER PEOPLE,
EMPOWER ENTERPRISE,
OPEN INNOVATION.

More Related Content

What's hot

SCALE 2011 Deploying OpenStack with Chef
SCALE 2011 Deploying OpenStack with ChefSCALE 2011 Deploying OpenStack with Chef
SCALE 2011 Deploying OpenStack with ChefMatt Ray
 
Linux network namespaces
Linux network namespacesLinux network namespaces
Linux network namespacesMike Wilson
 
[2015-11월 정기 세미나]K8s on openstack
[2015-11월 정기 세미나]K8s on openstack[2015-11월 정기 세미나]K8s on openstack
[2015-11월 정기 세미나]K8s on openstackOpenStack Korea Community
 
Docker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental NetworkingDocker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental NetworkingSreenivas Makam
 
Linux Container Technology 101
Linux Container Technology 101Linux Container Technology 101
Linux Container Technology 101inside-BigData.com
 
DockerとKubernetesをかけめぐる
DockerとKubernetesをかけめぐるDockerとKubernetesをかけめぐる
DockerとKubernetesをかけめぐるKohei Tokunaga
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Lxc – next gen virtualization for cloud   intro (cloudexpo)Lxc – next gen virtualization for cloud   intro (cloudexpo)
Lxc – next gen virtualization for cloud intro (cloudexpo)Boden Russell
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdKohei Tokunaga
 
Docker: Aspects of Container Isolation
Docker: Aspects of Container IsolationDocker: Aspects of Container Isolation
Docker: Aspects of Container Isolationallingeek
 
4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes
4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes
4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetesJuraj Hantak
 
4. Kubernetes - Application centric infrastructure kubernetes, contiv
4. Kubernetes - Application centric infrastructure  kubernetes, contiv4. Kubernetes - Application centric infrastructure  kubernetes, contiv
4. Kubernetes - Application centric infrastructure kubernetes, contivJuraj Hantak
 
OpenStack Korea 2015 상반기스터디(devops) 스크립트로 오픈스택 설치하기 20150728
OpenStack Korea 2015 상반기스터디(devops) 스크립트로 오픈스택 설치하기 20150728OpenStack Korea 2015 상반기스터디(devops) 스크립트로 오픈스택 설치하기 20150728
OpenStack Korea 2015 상반기스터디(devops) 스크립트로 오픈스택 설치하기 20150728jieun kim
 
Application-Based Routing
Application-Based RoutingApplication-Based Routing
Application-Based RoutingHungWei Chiu
 
Implementing SDN Testbed(ONOS & OpenVirteX)
Implementing SDN Testbed(ONOS & OpenVirteX)Implementing SDN Testbed(ONOS & OpenVirteX)
Implementing SDN Testbed(ONOS & OpenVirteX)sangyun han
 
20171010 multitenancy in openshift
20171010 multitenancy in openshift20171010 multitenancy in openshift
20171010 multitenancy in openshiftSmals
 
Pipework: Software-Defined Network for Containers and Docker
Pipework: Software-Defined Network for Containers and DockerPipework: Software-Defined Network for Containers and Docker
Pipework: Software-Defined Network for Containers and DockerJérôme Petazzoni
 
SGX Trusted Execution Environment
SGX Trusted Execution EnvironmentSGX Trusted Execution Environment
SGX Trusted Execution EnvironmentKernel TLV
 
How Networking works with Data Science
How Networking works with Data Science How Networking works with Data Science
How Networking works with Data Science HungWei Chiu
 
Control Your Network ASICs, What Benefits switchdev Can Bring Us
Control Your Network ASICs, What Benefits switchdev Can Bring UsControl Your Network ASICs, What Benefits switchdev Can Bring Us
Control Your Network ASICs, What Benefits switchdev Can Bring UsHungWei Chiu
 

What's hot (20)

SCALE 2011 Deploying OpenStack with Chef
SCALE 2011 Deploying OpenStack with ChefSCALE 2011 Deploying OpenStack with Chef
SCALE 2011 Deploying OpenStack with Chef
 
Linux network namespaces
Linux network namespacesLinux network namespaces
Linux network namespaces
 
[2015-11월 정기 세미나]K8s on openstack
[2015-11월 정기 세미나]K8s on openstack[2015-11월 정기 세미나]K8s on openstack
[2015-11월 정기 세미나]K8s on openstack
 
Docker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental NetworkingDocker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental Networking
 
Linux Container Technology 101
Linux Container Technology 101Linux Container Technology 101
Linux Container Technology 101
 
DockerとKubernetesをかけめぐる
DockerとKubernetesをかけめぐるDockerとKubernetesをかけめぐる
DockerとKubernetesをかけめぐる
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Lxc – next gen virtualization for cloud   intro (cloudexpo)Lxc – next gen virtualization for cloud   intro (cloudexpo)
Lxc – next gen virtualization for cloud intro (cloudexpo)
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into Containerd
 
Lxc- Introduction
Lxc- IntroductionLxc- Introduction
Lxc- Introduction
 
Docker: Aspects of Container Isolation
Docker: Aspects of Container IsolationDocker: Aspects of Container Isolation
Docker: Aspects of Container Isolation
 
4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes
4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes
4. CNCF kubernetes Comparison of-existing-cni-plugins-for-kubernetes
 
4. Kubernetes - Application centric infrastructure kubernetes, contiv
4. Kubernetes - Application centric infrastructure  kubernetes, contiv4. Kubernetes - Application centric infrastructure  kubernetes, contiv
4. Kubernetes - Application centric infrastructure kubernetes, contiv
 
OpenStack Korea 2015 상반기스터디(devops) 스크립트로 오픈스택 설치하기 20150728
OpenStack Korea 2015 상반기스터디(devops) 스크립트로 오픈스택 설치하기 20150728OpenStack Korea 2015 상반기스터디(devops) 스크립트로 오픈스택 설치하기 20150728
OpenStack Korea 2015 상반기스터디(devops) 스크립트로 오픈스택 설치하기 20150728
 
Application-Based Routing
Application-Based RoutingApplication-Based Routing
Application-Based Routing
 
Implementing SDN Testbed(ONOS & OpenVirteX)
Implementing SDN Testbed(ONOS & OpenVirteX)Implementing SDN Testbed(ONOS & OpenVirteX)
Implementing SDN Testbed(ONOS & OpenVirteX)
 
20171010 multitenancy in openshift
20171010 multitenancy in openshift20171010 multitenancy in openshift
20171010 multitenancy in openshift
 
Pipework: Software-Defined Network for Containers and Docker
Pipework: Software-Defined Network for Containers and DockerPipework: Software-Defined Network for Containers and Docker
Pipework: Software-Defined Network for Containers and Docker
 
SGX Trusted Execution Environment
SGX Trusted Execution EnvironmentSGX Trusted Execution Environment
SGX Trusted Execution Environment
 
How Networking works with Data Science
How Networking works with Data Science How Networking works with Data Science
How Networking works with Data Science
 
Control Your Network ASICs, What Benefits switchdev Can Bring Us
Control Your Network ASICs, What Benefits switchdev Can Bring UsControl Your Network ASICs, What Benefits switchdev Can Bring Us
Control Your Network ASICs, What Benefits switchdev Can Bring Us
 

Similar to Linux Container Technology inside Docker with RHEL7

Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Etsuji Nakai
 
Linux Containers and Docker SHARE.ORG Seattle 2015
Linux Containers and Docker SHARE.ORG Seattle 2015Linux Containers and Docker SHARE.ORG Seattle 2015
Linux Containers and Docker SHARE.ORG Seattle 2015Filipe Miranda
 
Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101LorisPack Project
 
Docker Platform and Ecosystem
Docker Platform and EcosystemDocker Platform and Ecosystem
Docker Platform and EcosystemPatrick Chanezon
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesYigal Elefant
 
Docker Security Overview
Docker Security OverviewDocker Security Overview
Docker Security OverviewSreenivas Makam
 
Diving Through The Layers: Investigating runc, containerd, and the Docker eng...
Diving Through The Layers: Investigating runc, containerd, and the Docker eng...Diving Through The Layers: Investigating runc, containerd, and the Docker eng...
Diving Through The Layers: Investigating runc, containerd, and the Docker eng...Phil Estes
 
Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Ricardo Amaro
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with DockerAndrey Hristov
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with DockerAndrey Hristov
 
Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Patrick Chanezon
 
Devoxx 2016: A Developer's Guide to OCI and runC
Devoxx 2016: A Developer's Guide to OCI and runCDevoxx 2016: A Developer's Guide to OCI and runC
Devoxx 2016: A Developer's Guide to OCI and runCPhil Estes
 

Similar to Linux Container Technology inside Docker with RHEL7 (20)

Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
 
Linux Containers and Docker SHARE.ORG Seattle 2015
Linux Containers and Docker SHARE.ORG Seattle 2015Linux Containers and Docker SHARE.ORG Seattle 2015
Linux Containers and Docker SHARE.ORG Seattle 2015
 
Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101
 
Core OS
Core OSCore OS
Core OS
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Docker Platform and Ecosystem
Docker Platform and EcosystemDocker Platform and Ecosystem
Docker Platform and Ecosystem
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
 
Docker Dojo
Docker DojoDocker Dojo
Docker Dojo
 
Docker Security Overview
Docker Security OverviewDocker Security Overview
Docker Security Overview
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Diving Through The Layers: Investigating runc, containerd, and the Docker eng...
Diving Through The Layers: Investigating runc, containerd, and the Docker eng...Diving Through The Layers: Investigating runc, containerd, and the Docker eng...
Diving Through The Layers: Investigating runc, containerd, and the Docker eng...
 
Resinio
ResinioResinio
Resinio
 
Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 
Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker
DockerDocker
Docker
 
Devoxx 2016: A Developer's Guide to OCI and runC
Devoxx 2016: A Developer's Guide to OCI and runCDevoxx 2016: A Developer's Guide to OCI and runC
Devoxx 2016: A Developer's Guide to OCI and runC
 
Docker
Docker Docker
Docker
 

More from Etsuji Nakai

「ITエンジニアリングの本質」を考える
「ITエンジニアリングの本質」を考える「ITエンジニアリングの本質」を考える
「ITエンジニアリングの本質」を考えるEtsuji Nakai
 
Googleのインフラ技術に見る基盤標準化とDevOpsの真実
Googleのインフラ技術に見る基盤標準化とDevOpsの真実Googleのインフラ技術に見る基盤標準化とDevOpsの真実
Googleのインフラ技術に見る基盤標準化とDevOpsの真実Etsuji Nakai
 
Introducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlowIntroducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlowEtsuji Nakai
 
Googleにおける機械学習の活用とクラウドサービス
Googleにおける機械学習の活用とクラウドサービスGoogleにおける機械学習の活用とクラウドサービス
Googleにおける機械学習の活用とクラウドサービスEtsuji Nakai
 
Spannerに関する技術メモ
Spannerに関する技術メモSpannerに関する技術メモ
Spannerに関する技術メモEtsuji Nakai
 
Googleのインフラ技術から考える理想のDevOps
Googleのインフラ技術から考える理想のDevOpsGoogleのインフラ技術から考える理想のDevOps
Googleのインフラ技術から考える理想のDevOpsEtsuji Nakai
 
A Brief History of My English Learning
A Brief History of My English LearningA Brief History of My English Learning
A Brief History of My English LearningEtsuji Nakai
 
TensorFlowプログラミングと分類アルゴリズムの基礎
TensorFlowプログラミングと分類アルゴリズムの基礎TensorFlowプログラミングと分類アルゴリズムの基礎
TensorFlowプログラミングと分類アルゴリズムの基礎Etsuji Nakai
 
TensorFlowによるニューラルネットワーク入門
TensorFlowによるニューラルネットワーク入門TensorFlowによるニューラルネットワーク入門
TensorFlowによるニューラルネットワーク入門Etsuji Nakai
 
Using Kubernetes on Google Container Engine
Using Kubernetes on Google Container EngineUsing Kubernetes on Google Container Engine
Using Kubernetes on Google Container EngineEtsuji Nakai
 
Lecture note on PRML 8.2
Lecture note on PRML 8.2Lecture note on PRML 8.2
Lecture note on PRML 8.2Etsuji Nakai
 
Machine Learning Basics for Web Application Developers
Machine Learning Basics for Web Application DevelopersMachine Learning Basics for Web Application Developers
Machine Learning Basics for Web Application DevelopersEtsuji Nakai
 
Your first TensorFlow programming with Jupyter
Your first TensorFlow programming with JupyterYour first TensorFlow programming with Jupyter
Your first TensorFlow programming with JupyterEtsuji Nakai
 
Deep Q-Network for beginners
Deep Q-Network for beginnersDeep Q-Network for beginners
Deep Q-Network for beginnersEtsuji Nakai
 
TensorFlowで学ぶDQN
TensorFlowで学ぶDQNTensorFlowで学ぶDQN
TensorFlowで学ぶDQNEtsuji Nakai
 
DevOpsにおける組織に固有の事情を どのように整理するべきか
DevOpsにおける組織に固有の事情を どのように整理するべきかDevOpsにおける組織に固有の事情を どのように整理するべきか
DevOpsにおける組織に固有の事情を どのように整理するべきかEtsuji Nakai
 
インタークラウドを実現する技術 〜 デファクトスタンダードからの視点 〜
インタークラウドを実現する技術 〜 デファクトスタンダードからの視点 〜インタークラウドを実現する技術 〜 デファクトスタンダードからの視点 〜
インタークラウドを実現する技術 〜 デファクトスタンダードからの視点 〜Etsuji Nakai
 

More from Etsuji Nakai (20)

PRML11.2-11.3
PRML11.2-11.3PRML11.2-11.3
PRML11.2-11.3
 
「ITエンジニアリングの本質」を考える
「ITエンジニアリングの本質」を考える「ITエンジニアリングの本質」を考える
「ITエンジニアリングの本質」を考える
 
Googleのインフラ技術に見る基盤標準化とDevOpsの真実
Googleのインフラ技術に見る基盤標準化とDevOpsの真実Googleのインフラ技術に見る基盤標準化とDevOpsの真実
Googleのインフラ技術に見る基盤標準化とDevOpsの真実
 
Introducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlowIntroducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlow
 
Googleにおける機械学習の活用とクラウドサービス
Googleにおける機械学習の活用とクラウドサービスGoogleにおける機械学習の活用とクラウドサービス
Googleにおける機械学習の活用とクラウドサービス
 
Spannerに関する技術メモ
Spannerに関する技術メモSpannerに関する技術メモ
Spannerに関する技術メモ
 
Googleのインフラ技術から考える理想のDevOps
Googleのインフラ技術から考える理想のDevOpsGoogleのインフラ技術から考える理想のDevOps
Googleのインフラ技術から考える理想のDevOps
 
A Brief History of My English Learning
A Brief History of My English LearningA Brief History of My English Learning
A Brief History of My English Learning
 
TensorFlowプログラミングと分類アルゴリズムの基礎
TensorFlowプログラミングと分類アルゴリズムの基礎TensorFlowプログラミングと分類アルゴリズムの基礎
TensorFlowプログラミングと分類アルゴリズムの基礎
 
TensorFlowによるニューラルネットワーク入門
TensorFlowによるニューラルネットワーク入門TensorFlowによるニューラルネットワーク入門
TensorFlowによるニューラルネットワーク入門
 
Using Kubernetes on Google Container Engine
Using Kubernetes on Google Container EngineUsing Kubernetes on Google Container Engine
Using Kubernetes on Google Container Engine
 
Lecture note on PRML 8.2
Lecture note on PRML 8.2Lecture note on PRML 8.2
Lecture note on PRML 8.2
 
Machine Learning Basics for Web Application Developers
Machine Learning Basics for Web Application DevelopersMachine Learning Basics for Web Application Developers
Machine Learning Basics for Web Application Developers
 
Your first TensorFlow programming with Jupyter
Your first TensorFlow programming with JupyterYour first TensorFlow programming with Jupyter
Your first TensorFlow programming with Jupyter
 
Deep Q-Network for beginners
Deep Q-Network for beginnersDeep Q-Network for beginners
Deep Q-Network for beginners
 
Life with jupyter
Life with jupyterLife with jupyter
Life with jupyter
 
TensorFlowで学ぶDQN
TensorFlowで学ぶDQNTensorFlowで学ぶDQN
TensorFlowで学ぶDQN
 
DevOpsにおける組織に固有の事情を どのように整理するべきか
DevOpsにおける組織に固有の事情を どのように整理するべきかDevOpsにおける組織に固有の事情を どのように整理するべきか
DevOpsにおける組織に固有の事情を どのように整理するべきか
 
PRML7.2
PRML7.2PRML7.2
PRML7.2
 
インタークラウドを実現する技術 〜 デファクトスタンダードからの視点 〜
インタークラウドを実現する技術 〜 デファクトスタンダードからの視点 〜インタークラウドを実現する技術 〜 デファクトスタンダードからの視点 〜
インタークラウドを実現する技術 〜 デファクトスタンダードからの視点 〜
 

Recently uploaded

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Linux Container Technology inside Docker with RHEL7

  • 1. Linux Container Technology inside Docker with RHEL7 Etsuji Nakai Senior Solution Architect and Cloud Evangelist Red Hat K.K v1.1 2015/08/28
  • 2. 2 Linux Container Technology inside Docker with RHEL7 $ who am i  中井悦司 / Etsuji Nakai – Twitter @enakai00 – Senior Solution Architect and Cloud Evangelist at Red Hat. – The author of Linux and OpenStack books.
  • 3. 3 Linux Container Technology inside Docker with RHEL7 Contents  What is Docker?  Container Technology inside Docker  Architecture of Kubernetes  References
  • 5. 5 Linux Container Technology inside Docker with RHEL7 Quick Demo!
  • 6. 6 Linux Container Technology inside Docker with RHEL7 Dockerfile ① Auto-build Docker images OS Image Application Library / Framework Application Binary Describe steps to build an image Docker image Everything you need to run application is included in the image ② Upload and publish images ③ Download and run What you can do with Docker
  • 8. 8 Linux Container Technology inside Docker with RHEL7  "Linux Container" is a Linux kernel feature to contain a group of processes in an independent execution environment.  Linux kernel provides an independent application execution environment for each container including: – Independent filesystem. – Independent network interface and IP address. – Usage limit for memory and CPU time. Linux Kernel UserProcess ・・・ Physical Host / VM Physical Host / VM OS ContainerNo Container UserProcess UserProcess User Space Linux Kernel UserProcess UserProcess User Space UserProcess UserProcess User Space ・・・ What is container technology? Container
  • 9. 9 Linux Container Technology inside Docker with RHEL7  Container supports separation of various resources. They are internally realized with different technologies called "namespace." – Filesystem separation  → Mount namespace (kernel 2.4.19) – Hostname separation → UTS namespace (kernel 2.6.19) – IPC separation → IPC namespace (kernel 2.6.19) – User (UID/GID) separation → User namespace (kernel 2.6.23〜kernel 3.8) – Processtable separation  → PID namespace (kernel 2.6.24)  – Network separation    → Network Namespace (kernel 2.6.24) – Usage limit of CPU/Memory → Control groups  Linux container is realized with integrating these namespace features. There are multiple container management tools such as lxctools, libvirt and docker. They may use different parts of these features. Under the hood
  • 10. 10 Linux Container Technology inside Docker with RHEL7 Filesystem  A specific directory on the host is bind mounted as a root directory of the container. Inside container, that directory is seen as a root directory, very similar mechanism to the "chroot jail."  When using traditional container management tools such as lxctools or libvirt, you need to prepare the directory contents by hand. – You can put minimum contents for a specific application such as application binaries and shared libraries in the directory. – It's also possible to copy a whole root filesystem of a specific linux distribution to the directory. – If necessary, special filesystems such as /dev, /proc and /sys are mounted in the container by the management tool. Mount namespace / |--etc |--bin |--sbin ... /export/container01/rootfs/ |--etc |--bin |--sbin ... bind mount
  • 11. 11 Linux Container Technology inside Docker with RHEL7 Filesystem Container Application Directory Tree Mounted on the host Assign as / filesystem  With Docker, you don't need to prepare the directory tree by hand.  Docker image is mounted on the host and used as root filesystem of the container. Docker Image
  • 12. 12 Linux Container Technology inside Docker with RHEL7  Processes in all containers are executed on the same Linux kernel. But, inside a container, you can see processes only in the container. – This is because each container has its own process table. On host linux, which is outside containers, you can see all processes including ones in containers. Process table # ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 09:49 ? 00:00:00 /bin/sh /usr/local/bin/init.sh root 47 1 0 09:49 ? 00:00:00 /usr/sbin/httpd apache 49 47 0 09:49 ? 00:00:00 /usr/sbin/httpd apache 50 47 0 09:49 ? 00:00:00 /usr/sbin/httpd ... apache 56 47 0 09:49 ? 00:00:00 /usr/sbin/httpd root 57 1 0 09:49 ? 00:00:00 /bin/bash # ps -ef UID PID PPID C STIME TTY TIME CMD ... root 802 1 0 18:10 ? 00:01:20 /usr/bin/docker -d --selinux-enabled -H fd:// ... root 3687 802 0 18:49 pts/2 00:00:00 /bin/sh /usr/local/bin/init.sh root 3748 3687 0 18:49 ? 00:00:00 /usr/sbin/httpd 48 3750 3748 0 18:49 ? 00:00:00 /usr/sbin/httpd ... 48 3757 3748 0 18:49 ? 00:00:00 /usr/sbin/httpd root 3758 3687 0 18:49 pts/2 00:00:00 /bin/bash Processes seen inside container Processes seen outside container
  • 13. 13 Linux Container Technology inside Docker with RHEL7 Process table fork/exec PID namespace  In the example of previous page, docker daemon fork/exec-ed the initial process "init.sh" and put it in a new "PID namespace." After that, all processes fork/exec-ed from init.sh are put in the same namespace.  Inside container, the initial process has PID=1 independently from the host. Likewise, child processes of it have independent PID's. PID=1 bash /bin/sh /usr/local/bin/init.sh httpd httpd ・・・ #!/bin/sh service httpd start while [[ true ]]; do /bin/bash done init.sh docker daemon
  • 14. 14 Linux Container Technology inside Docker with RHEL7 Network namespace Network  Container uses Linux's "veth" device for network communication. – veth is a pair of logical NIC devices connected through a (virtual) crossover cable.  One side of the veth pair is placed in a container's network namespace so that it can be seen only inside the container. The other side is connected to a Linux bridge on the host. – A device name in the container is renamed such as "eth0." By means of the namespace, network settings such as IP address, routing table and iptables are independently configured in the container. – The connection between the bridge and a physical network is up to the host configuration. Host Linux vethXX eth0 docker0 eth0 Physical network  Docker creates a bridge "docker0" as a connection point of container's network. – Packets from containers are forwarded with IP masquerade. – Packets from the physical network targeted to specified ports are forwarded to the container using the port forwarding feature of iptables. 172.17.42.1# docker run -it -p 8000:80 ... Accessing to the external IP of the host TCP 8000 TCP 80 Port forwarding
  • 15. 15 Linux Container Technology inside Docker with RHEL7 Network  Example container network for 3-tier application running on the same host. Accessing to the external IP of the host Container:Web Server REST_PORT_5555_TCP_ADDR eth0 DB_PORT_3306_TCP_ADDR Container:App Server eth0 Container:Database eth0 Linux bridge(docker0) External IP Port 80 Port 5555 Port 3306 Port 80
  • 16. 16 Linux Container Technology inside Docker with RHEL7 Network  Example container network for 3-tier application running on different hosts. REST_PORT_5555_TCP_ADDR eth0 External IP REST_PORT_5555_TCP_ADDR eth0 External IP eth0 External IP Container:Web Server Container:App Server Container:Database Port 80 Port 5555 Port 3306
  • 18. 18 Linux Container Technology inside Docker with RHEL7 Server configuration etcd ・・・ Backend Database(KVS) Kubernetes Master Kubernetes Node ・・・ Scale-out cluster Docker Docker Docker Add more nodes if necessary. Docker Registry  Kubernetes manages multiple nodes from a single master. – Clustering of multiple masters is not available now. You may use active-standby configuration with standard HA tools for high availability. – etcd (KVS) is used as a backend database. It can be configured as a scale-out cluster.
  • 19. 19 Linux Container Technology inside Docker with RHEL7 Network configuration etcd Kubernetes Master Docker Registry Configured as an overlay network. ・・・  Physical network is simple. Kubernetes works just by connecting all servers to a single service network.  However, you need to create an internal network for container communication using an overlay network. – You may use Flannel, Open vSwitch, etc. as an overlay technology. Service network 192.168.122.0/24 Node docker0 Node docker0 Internal network 10.1.0.0/16
  • 20. 20 Linux Container Technology inside Docker with RHEL7 External access etcd Kubernetes Master Node Docker Registry Node API requests Image upload ・・・ Service access  There are following cases for the external access. – API requests are sent to the master. – Services running on containers are accessed from nodes' external IPs via proxy mechanism. – Docker registry is an independent component from Kubernetes. You may use a registry server running on a container. Service network Internal network
  • 21. 21 Linux Container Technology inside Docker with RHEL7 Service  You need to define a service so that you can access the containers inside pods. An private and (optionally public) IP is assigned to each service. – You define a single service which aggregates the multiple pods running the same image. Access to the "IP + port" associated to a service is transferred to the backend pods with the round-robin manner.  When defining a service, you need to explicitly specify a port number. A "private IP" is automatically assigned. The private IP is used for accessing from other pods (not external uses.) – Access to the private IP is received by the proxy daemon running on the local node, and transferred to the backend pods. – When launching a new pod, the private IPs and ports of existing services are set in the environment variables inside new containers. Pod ProxyThe local proxy daemon receives the packets to the private IP. Pod Proxy Round-robin access via the internal network. Pod Proxy Node Node Node
  • 22. 22 Linux Container Technology inside Docker with RHEL7 Node External access to services Service access  You can specify multiple public IPs for each service. – By that, external users can access the service via multiple nodes so that a specific node does not become a SPOF. – External mechanism to select/load balance multiple nodes is required. Typically, you can use the DNS load balancing. Pod Proxy The proxy daemon receives packets to service ports. Accessing to the nodes' public IPs. Node Pod Proxy Round-robin access via the internal network.  When defining a service, you need to specify "Public IPs" if you need to make it accessible from external users. – Public IPs' correspond to nodes' IP addresses from which external uses can access the service. – The packets to the corresponding nodes (for the service port) are received by the proxy daemon, and transferred to the backend pods.
  • 23. 23 Linux Container Technology inside Docker with RHEL7 Baremetal / VM ・・・ Docker Baremetal / VM Docker Kubernetes Platform as a Service ・・・ Execution Resource Container Management Container Orchestration UI, Monitoring, Image build workflow, etc. RHEL Atomic Host OpenShift 3.0 Beyond Kubernetes: OpenShift v3 Container Container Container Container ・・・ ・・・
  • 25. 25 Linux Container Technology inside Docker with RHEL7 References  Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1 – http://www.slideshare.net/enakai/architecture-overview-rubbernecks-with-red- hat-enterprise-linux-71  Inside Docker for Fedora20/RHEL7 – http://www.slideshare.net/enakai/docker-technology-v18e  OpenShift 3 Technical Architecture – https://docs.google.com/presentation/d/1Isp5UeQZTo3gh6e59FMYmMs_V9QIQeBel mbyHIJ1H_g/pub  OpenShift v3 Internal networking details – http://www.slideshare.net/enakai/openshift-45465283