Table Of ContentMastering CoreOS
Table of Contents
Mastering CoreOS
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. CoreOS Overview
Distributed application development
Components of distributed application development
Advantages and disadvantages
A minimalist Container-optimized OS
Containers
Technology
Advantages
An overview of Docker architecture
Advantages of Docker
CoreOS
Properties
Advantages
Supported platforms
CoreOS components
Kernel
Systemd
Systemd units
Etcd2.service
Fleet.service
Docker.service
The procedure to start a simple systemd service
Demonstrating systemd HA
Etcd
Etcd discovery
Cluster size
Etcd cluster details
Simple set and get operations using etcd
Fleet
The Fleet architecture
A Fleet scheduling example
A global unit example
Scheduling based on metadata
Fleet HA
Flannel
A Flannel service unit
Rkt
The CoreOS cluster architecture
The development cluster
The production cluster
Docker versus Rkt
History
APPC versus OCI
The current status
Differences between Docker and Rkt
A workflow for distributed application development with Docker and CoreOS
Summary
References
Further reading and tutorials
2. Setting up the CoreOS Lab
Cloud-config
The CoreOS cloud-config file format
The main sections of cloud-config
A sample CoreOS cloud-config
The cloud-config validator
A hosted validator
Valid cloud-config
Invalid cloud-config
The cloudinit validator
Executing cloud-config
The CoreOS cluster with Vagrant
Steps to start the Vagrant environment
Important files to be modified
Vagrantfile
User-data
Config.rb
Vagrant – a three-node cluster with dynamic discovery
Generating a discovery token
Steps for cluster creation
Vagrant – a three-node cluster with static discovery
Vagrant – a production cluster with three master nodes and three worker nodes
A CoreOS cluster with AWS
AWS – a three-node cluster using Cloudformation
AWS – a three-node cluster using AWS CLI
A CoreOS cluster with GCE
GCE – a three-node cluster using GCE CLI
CoreOS installation on Bare Metal
Basic debugging
journalctl
systemctl
Cloud-config
Logging from one CoreOS node to another
Important files and directories
Common mistakes and possible solutions
Summary
References
Further reading and tutorials
3. CoreOS Autoupdate
The CoreOS release cycle
The partition table on CoreOS
CoreOS automatic update
Update and reboot services
Update-engine.service
Debugging update-engine.service
Locksmithd.service
Locksmith strategy
The etcd-lock scheme
Reboot
Best-effort
Off
Groups
Locksmithctl
Debugging locksmithd.service
Setting update options
Using cloud-config
Manual configuration
Update examples
Updating within the same release channel
Updating from one release channel to another
CoreUpdate
Vagrant CoreOS update
Summary
References
Further reading and tutorials
4. CoreOS Primary Services – Etcd, Systemd, and Fleet
Etcd
Versions
Installation
Standalone installation
Accessing etcd
REST
Etcdctl
Etcd configuration
Etcd operations
Etcd tuning
Etcd proxy
Adding and removing nodes from a cluster
Node migration and backup
Etcd security
Certificate authority – etcd-ca
Installing etcd-ca
Etcd secure client-to-server communication using a server certificate
Etcd secure client-to-server communication using server certificate and
client certificate
A secure cloud-config
Authentication
Etcd debugging
Systemd
Unit types
Unit specifiers
Unit templates
Drop-in units
Default cloud-config drop-in units
Cloud-config custom drop-in units
Runtime drop-in unit – specific parameters
Runtime drop-in unit – full service
Network units
Fleet
Installation
Accessing Fleet
Local fleetctl
Remote fleetctl
Remote fleetctl with an SSH tunnel
Remote HTTP
Using etcd security
Templates, scheduling, and HA
Debugging
Service discovery
Simple etcd-based discovery
Sidekick discovery
ELB service discovery
Summary
References
Further reading and tutorials
5. CoreOS Networking and Flannel Internals
Container networking basics
Flannel
Manual installation
Installation using flanneld.service
Control path
Data path
Flannel as a CNI plugin
Setting up a three-node Vagrant CoreOS cluster with Flannel and Docker
Setting up a three-node CoreOS cluster with Flannel and RKT
An AWS cluster using Flannel
An AWS cluster using VXLAN networking
An AWS cluster using AWS-VPC
A GCE cluster using Flannel
GCE cluster using VXLAN networking
A GCE cluster using GCE networking
Experimental multitenant networking
Experimental client-server networking
Setting up client-server Flannel networking
Docker networking
Docker experimental networking
A multinetwork use case
The Docker overlay driver
The external networking calico plugin
The Docker 1.9 update
Other Container networking technologies
Weave networking
Calico networking
Setting up Calico with CoreOS
Kubernetes networking
Summary
References
Further reading and tutorials
6. CoreOS Storage Management
Storage concepts
The CoreOS filesystem
Mounting the AWS EBS volume
Mounting NFS storage
Setting up NFS server
Setting up the CoreOS node as a client for the NFS
The container filesystem
Storage drivers
Docker and the Union filesystem
Container data
Docker volumes
Container volume
Volumes with the host mount directory
A data-only container
Removing volumes
The Docker Volume plugin
Flocker
Flocker volume migration using AWS EBS as a backend
Flocker volume migration using the ZFS backend
Flocker on CoreOS with an AWS EBS backend
Flocker recent additions
GlusterFS
Setting up a GlusterFS cluster
Setting up GlusterFS for a CoreOS cluster
Accessing GlusterFS using the Docker Volume plugin
Ceph
NFS
Container data persistence using NFS
The Docker 1.9 update
Summary
References
Further reading and tutorials
7. Container Integration with CoreOS – Docker and Rkt
Container standards
App container specification
The Container image format
Container image discovery
Simple discovery
Meta discovery
The app container executor
App container pods
The app container metadata service
APPC tools
Actool
Acbuild
Docker2aci
Open Container Initiative
Runc
The relationship of OCI with APPC
OCI and APPC latest updates
Libnetwork
CNI
The relationship between Libnetwork and CNI
Cloud Native Computing Foundation
Docker
The Docker daemon and an external connection
Dockerfile
The Docker Image repository
Creating your own Docker registry
Continuous integration
The Docker content trust
Pushing secure image
Pulling secure image
Pulling same image with no security
Container debugging
Logs
Login inside Container
Container properties
Container processes
The Container’s CPU and memory usage
Rkt
Basic commands
Fetch image
List images
Run image
List pods
Garbage collection
Delete image
Export image
The nginx container with volume mounting and port forwarding
Pod status
Rkt image signing
Rkt with systemd
Rkt with Flannel
Summary
References
Further reading and tutorials
8. Container Orchestration
Modern application deployment
Container Orchestration
Kubernetes
Concepts of Kubernetes
Pods
Networking
Services
Kubernetes architecture
Kubernetes installation
Non-Coreos Kubernetes installation
Kubectl installation
Vagrant installation
GCE installation
AWS installation
An example of a Kubernetes application
Kubernetes with Rkt
Kubernetes 1.1 update
Docker Swarm
The Docker Swarm installation
An example of Docker Swarm
Mesos
Comparing Kubernetes, Docker Swarm, and Mesos
Application definition
Docker-compose
A single-node application
A multinode application
Packaged Container Orchestration solutions
The AWS Container service
Installing ECS and an example
Google Container Engine
Installing GCE and an example
CoreOS Tectonic
Summary
References
Further reading and tutorials
9. OpenStack Integration with Containers and CoreOS
An overview of OpenStack
CoreOS on OpenStack
Get OpenStack Kilo running in Devstack
Setting up keys and a security group
Setting up external network access
Download the CoreOS image and upload to Glance
Updating the user data to be used for CoreOS
OpenStack and Containers
The Nova Docker driver
Installing the Nova Driver
Installing Docker