4. What is DevOps?
• DevOps (Developers + Operations)
• Software development methodology
• Culture
• Emphasize on communication, collaboration and integration.
• Achieve rapid release.
Developer Operations
Rapid Change StabilitySeparate workflow
Different object
Different situation
5. Key points in DevOps
• Worth & Object
• Respect
• Share value
• Share ownership
• Agreement
• Process
• Share same workflow
• Synchronize focus
• Decrease cycle time
• Tool
• Automation
• Package
• Build
• Test
Operating System
Infrastructure
Application
Platform
QA
DevOps
DevOps is not only development culture but also collaboration process
,which could develop and operate service independently in a organization
6. DevOps
• Benefit
• Innovate faster
• More responsive to business needs
• Better collaboration
• Better quality
• More frequent releases
• Necessary
• New Mindset (Open mind)
• New Tools (Provisioning, Monitoring, etc)
• New Skills (From platform to QA)
8. Why DevOps prefer docker?
• Container-based Platform
• Easy/Fast deployment, build, provisioning
• Similar performance compared to bare-metal
• Low learning curve (Dockerfile use bash shell)
• Ansible(Python)/ Chef(Ruby and Erlang) / Puppet(Ruby)
• RedHat, IBM, Microsoft, CoreOS... Many companies support.
9. DevOps needs more…
• Reliable system management. (Atomic Host, etc)
• Handle network complexity (OVS, flanneld, etc)
• Management module for bigger infrastructure. (Kubernetes, etc)
Docker in real
Minimal Docker
10. What is Atomic Host?
• Trusted operating system platform
• Container-based application
• Service deployment
• End-to-End hosting architecture that’s modern, reliable and secure.
Reliable distribution OS High Secure Module
SELinux
Container Management
11. Atomic Host Feature
• Support packages
• Docker
• Flannel
• Kubernetes
• rpm-ostree
• Support various file system for Docker
• vfs
• devicemapper
• btrfs
• aufs (not recommend for production, not supported)
• Networking
• Single-host networking : Docker
• Multi-host networking : Kubernetes & Flannel
12. How to debug Atomic Host ?
• Atomic Host is minimal of RHEL system.
• Does NOT use “YUM” on Atomic Host.
• How debug or install packages?
• Red hat provide “Red Hat Enterprise Linux Atomic Tools Container Image”
• It’s Big (1G)
• Contains man pages
• Opens privileges
• May behave differently
• How?
# docker pull rhel7/rhel-tools
# atomic run rhel7/rhel-tools
[root@localhost /]#
13. What is Kubernetes?
• Greek for “pilot” or “helmsman of a ship”
• Kubernetes is an open source Container Cluster orchestration framework that
was started by Google in 2014.
14. Kubernetes do WHAT?
• Manage docker containers centrally.
• Manage nodes.
• Handle complex networking.
…..
Manage a cluster of Linux containers as a single system
to accelerate Dev and simplify Ops
16. Main Terms
• Master
• Managing machine, which oversees one or more minions.
• Minion
• A slave that runs tasks as delegated by the user and Kubernetes master.
• Pod
• An application (or part of an application) that runs on a minion.
• Replication Controller
• Ensures that the requested number of pods are running on minions at all times.
• Label
• An arbitrary key/value pair that the Replication Controller uses for service discovery
• Service
• An endpoint that provides load balancing across a replicated group of pods
• kubectl
• The command line config tool
17. Main Components
• API Server
• REST server
• Controller Tower
• Controller Manager
• Replication Controller Management (Watches etcd)
• Scheduler
• Communicate with minions
• Decide a minion to distribute workload
• Check if the task happen.
• Kubelet
• Manage container deployments
• Ensure the state of containers (which is supposed to be in)
• Kube-proxy
• Route and forward traffic to and from containers
• ETCD
• Distributed, consistent key value store for shared configuration and service discovery
18. How to configure Kubernetes?
# Comma seperated list of nodes in the etcd cluster
KUBE_ETCD_SERVERS="--etcd_servers=http://192.168.20.10:4001"
configure
# The address on the local server to listen to.
KUBE_API_ADDRESS="--address=0.0.0.0"...
# How the replication controller and scheduler find the kube-apiserver
KUBE_MASTER="--master=192.168.20.10:8080"
apiserver
# Comma seperated list of minions
KUBELET_ADDRESSES="--machines=minion1,minion2,minion3,minion4"
controller-manager
Service Register
# systemctl enable etcd kube-apiserver kube-controller-manager kube-scheduler
Service Start
# systemctl start etcd kube-apiserver kube-controller-manager kube-scheduler
Service Check
# systemctl status etcd kube-apiserver kube-controller-manager kube-scheduler
# systemctl status etcd kube-apiserver kube-controller-manager kube-scheduler | grep active |wc –l
4
Master :
/etc/kubernetes/
20. How to configure Kubernetes?
Minion
Create /etc/sysconfig/flanneld
# etcd url location. Point this to the server where etcd runs
FLANNEL_ETCD="http://192.168.122.10:4001"
# etcd config key. This is the configuration key that flannel queries
# For address range assignment
FLANNEL_ETCD_KEY="/atomic01/network"
[Unit]
After=flanneld.service
Requires=flanneld.service
[Service]
EnvironmentFile=/run/flannel/subnet.env
ExecStartPre=-/usr/sbin/ip link del docker0
ExecStart=/usr/bin/docker -d --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}
$OPTIONS $DOCKER_STORAGE_OPTIONS
Create /etc/systemd/system/docker.service.d/10-flanneld-network.conf
Flanneld Configuration
21. How to configure Kubernetes?
# Comma seperated list of nodes in the etcd cluster
KUBE_ETCD_SERVERS="--etcd_servers=http://192.168.20.10:4001“
config
# The address for the info server to serve on (set to 0.0.0.0 or "" for all
interfaces)
KUBELET_ADDRESS="--address=192.168.20.11"..
.# You may leave this blank to use the actual hostname
KUBELET_HOSTNAME="--hostname_override=minion1"
kubelet
Minion
22. What does Flanneld do?
ens3
192.168.10.11
docker0
172.17.42.1/16
veth0
172.17.0.1/24
veth0
172.17.0.2/24
Atomic Host
Pod A Pod B
Apache container Apache container
Apache container in Pod A
Apache container in Pod B
Communication ??
23. What does Flanneld do?
ens3
192.168.10.11
docker0
172.17.42.1/16
veth0
172.17.0.1/24
veth0
172.17.0.2/24
Atomic Host
Pod A Pod B
Apache container Apache container
Apache container in Pod A
Apache container in Pod B
Communication OK
through docker0 bridge
24. What does Flanneld do?
ens3
192.168.10.11
docker0
172.17.42.1/16
veth0
172.17.0.1/24
veth0
172.17.0.2/24
Atomic Host
Pod A Pod B
Apache container Apache container
ens3
192.168.10.12
docker0
172.17.42.1/16
veth0
172.17.0.1/24
veth0
172.17.0.2/24
Atomic Host
Pod C Pod D
Apache container Apache container
br0
192.168.10.1
25. What does Flanneld do?
ens3
192.168.10.11
docker0
172.17.42.1/16
veth0
172.17.0.1/24
veth0
172.17.0.2/24
Atomic Host
Pod A Pod B
Apache container Apache container
ens3
192.168.10.12
docker0
172.17.42.1/16
veth0
172.17.0.1/24
veth0
172.17.0.2/24
Atomic Host
Pod C Pod D
Apache container Apache container
br0
192.168.10.1
Apache container in Pod A Apache container in Pod C
Communication ??
26. What does Flanneld do?
ens3
192.168.10.11
docker0
172.17.42.1/16
veth0
172.17.0.1/24
veth0
172.17.0.2/24
Atomic Host
Pod A Pod B
Apache container Apache container
ens3
192.168.10.12
docker0
172.17.42.1/16
veth0
172.17.0.1/24
veth0
172.17.0.2/24
Atomic Host
Pod C Pod D
Apache container Apache container
br0
192.168.10.1
Apache container in Pod A Apache container in Pod C
Communication NO
27. What does Flanneld do?
ens3
192.168.10.11
docker0
172.16.32.1/24
veth0
172.16.32.2/24
veth0
172.16.32.3/24
Atomic Host
Pod A Pod B
Apache container Apache container
br0
192.168.10.1
Flannel.1
172.16.32.0/16
flanneld
ens3
192.168.10.12
docker0
172.16.10.1/24
veth0
172.16.10.2/24
veth0
172.16.10.3/24
Atomic Host
Pod C Pod D
Apache container Apache container
Flannel.1
172.16.10.0/16
flanneld
Apache container in Pod A Apache container in Pod C
Communication YES