O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Container Networking

Book Description

Companies that begin working with containerized applications often aren’t prepared for the challenge of container networking. When you want to connect your containerized Python app to a container that has a database, you enter a domain that still demands a good deal of trial and error. This practical ebook delivers basic guidance on container networking with best practices that, until now, have been scattered throughout the web.

Michael Hausenblas, a member of Red Hat’s OpenShift team, provides developers, site reliability engineers, and software architects with a detailed look at the many challenges of container networking, container orchestration, and service discovery and shares several available solutions. Along the way, you’ll learn the capabilities of many open source tools, including Kubernetes.

  • Get an introduction to container networking by exploring single-host Docker networking modes
  • Examine issues that arise when you move to multihost container networking
  • Maintain a map of running containers and their locations with service discovery tools such as ZooKeeper and etcd
  • Configure network interfaces in Linux containers by using plugins with the Container Network Interface (CNI)
  • Learn how the Kubernetes orchestration system approaches container networking

Table of Contents

  1. Preface
    1. Why I Wrote This Book
    2. Who Is This Book For?
    3. About Me
    4. Acknowledgments
  2. 1. Motivation
    1. Introducing Pets Versus Cattle
    2. Go Cattle!
    3. The Container Networking Stack
    4. Do I Need to Go “All In”?
  3. 2. Introduction to Container Networking
    1. Single-Host Container Networking 101
    2. Modes for Docker Networking
      1. Bridge Mode Networking
      2. Host Mode Networking
      3. Container Mode Networking
      4. No Networking
    3. Administrative Considerations
    4. Wrapping It Up
  4. 3. Multi-Host Networking
    1. Multi-Host Container Networking 101
    2. Options for Multi-Host Container Networking
      1. flannel
      2. Weave Net
      3. Project Calico
      4. Open vSwitch
      5. OpenVPN
    3. Docker Networking
    4. Administrative Considerations
    5. Wrapping It Up
  5. 4. Orchestration
    1. What Does a Scheduler Actually Do?
    2. Docker
      1. Swarm Mode
      2. Docker Swarm
    3. Apache Mesos
    4. Hashicorp Nomad
    5. Community Matters
    6. Wrapping It Up
  6. 5. Service Discovery
    1. The Challenge
    2. Technologies
      1. ZooKeeper
      2. etcd
      3. Consul
      4. Pure-Play DNS-Based Solutions
      5. Airbnb’s SmartStack and Netflix’s Eureka
    3. Load Balancing
    4. Wrapping It Up
  7. 6. The Container Network Interface
    1. History
    2. Specification and Usage
    3. Container Runtimes and Plug-ins
    4. Wrapping It Up
  8. 7. Kubernetes Networking
    1. A Gentle Kubernetes Introduction
    2. Kubernetes Networking Overview
    3. Intra-Pod Networking
    4. Inter-Pod Networking
    5. Service Discovery in Kubernetes
      1. Environment Variables–Based Service Discovery
      2. DNS-Based Service Discovery
    6. Ingress and Egress
      1. Ingress
      2. Egress
    7. Advanced Kubernetes Networking Topics
      1. Network Policies
      2. Service Meshes
    8. Wrapping It Up
  9. A. References
    1. Container Networking References
      1. Networking 101
      2. Linux Kernel and Low-Level Components
      3. Docker
    2. Kubernetes Networking References
      1. Kubernetes Proper and Docs
      2. General Kubernetes Networking