Consul: Up and Running

Book description

With the advent of microservices, Kubernetes, public cloud, and hybrid computing, site reliability and DevOps engineers are facing more complexity than ever before. Service mesh is an exciting new technology that promises to help tackle this complexity. A service mesh provides you with a unified control plane to manage application networking across these distinct platforms.

With this definitive guide, you'll learn how to automate networking for simple and secure application delivery with Consul.

Author Luke Kysow, Consul engineer at HashiCorp, demonstrates how this service mesh solution provides a software-driven approach to security, observability, reliability, and traffic management. Once you learn how to deploy Consul on multiple platforms, you'll be able to take control of application traffic, prevent outages, view metrics, integrate with legacy systems, and more.

  • Dive into the characteristics of service meshes, zero trust networking, and traffic-shaping patterns
  • Deploy Consul on Kubernetes and virtual machines
  • Learn how to secure, monitor, and manage your application traffic with Consul
  • Use this guide to deploy and operate applications as a platform operator, DevOps engineer, or developer

Publisher resources

View/Submit Errata

Table of contents

  1. Foreword
  2. Preface
    1. Who Should Read This Book
    2. Navigating This Book
    3. What Is Not in This Book
    4. Conventions Used in This Book
    5. Using Code Examples
    6. O’Reilly Online Learning
    7. How to Contact Us
    8. Acknowledgments
  3. 1. Service Mesh 101
    1. How a Service Mesh Works
      1. Sidecar Proxies
      2. Control Plane
      3. Concrete Example
    2. Why Use a Service Mesh
      1. Security
      2. Observability
      3. Reliability
      4. Traffic Control
      5. Features in Combination
    3. When to Use a Service Mesh
    4. Summary
  4. 2. Introduction to Consul
    1. Architecture
      1. Consul Servers
      2. Consul Clients
      3. Sidecar Proxies
      4. Example Use Case
    2. Consul Versus Other Meshes
    3. Consul’s Other Features
    4. Summary
  5. 3. Deploying Consul
    1. Deploying Consul on Kubernetes
      1. Provisioning a Kubernetes Cluster
      2. Installing Consul with the consul-k8s CLI
    2. Deploying Consul on VMs
      1. Provisioning a Local VM
      2. Installing and Configuring Consul
      3. systemd
    3. Interacting with Consul
      1. Consul’s UI
      2. Consul’s CLI
      3. Consul’s API
    4. Summary
  6. 4. Adding Services to the Mesh
    1. Birdwatcher Example Service
    2. Deploying Services on Kubernetes
    3. Adding Kubernetes Services to the Mesh
    4. Deploying Services on VMs
    5. Registering VM Services with Consul
    6. Deploying Sidecar Proxies on VMs
    7. Configuring Routing on VMs
    8. Summary
  7. 5. Ingress Gateways
    1. Why You Need an Ingress Gateway
    2. Deploying an Ingress Gateway on Kubernetes
    3. Deploying an Ingress Gateway on VMs
    4. Config Entries
      1. Config Entries on Kubernetes
      2. Config Entries on VMs
    5. Configuring Ingress Gateways
      1. Configuring Ingress Gateways on Kubernetes
      2. Configuring Ingress Gateways on VMs
    6. Testing Out Your Ingress Gateway
    7. Ingress Gateways in Production
    8. Summary
  8. 6. Security
    1. Zero Trust Networking
    2. Encryption
      1. TLS Encryption
      2. Consul Encryption
    3. Authentication
    4. Authorization and Intentions
      1. Configuring Intentions with Consul’s UI
      2. Configuring Intentions with Config Entries
      3. Application Aware Intentions
    5. Summary
  9. 7. Observability
    1. Metrics
      1. Deploying and Configuring Prometheus
      2. Emitting Metrics
      3. Viewing Consul UI Metrics
      4. Grafana
    2. Distributed Tracing
      1. How Tracing Works
      2. Instrumenting Your Services
      3. Tracing Collectors
      4. Viewing Service Traces
      5. Enabling Tracing for the Service Mesh
      6. Analyzing Service Mesh Traces
    3. Summary
  10. 8. Reliability
    1. Health Checking
      1. Active Versus Passive Health Checking
      2. Configuring Active Health Checks
      3. Passive Health Checks
    2. Retries
    3. Timeouts
    4. Summary
  11. 9. Traffic Control
    1. Deployment Strategies
      1. Rolling Deployments
      2. Blue/Green Deployments
      3. Canary Deployments
    2. Load Balancers Versus the Service Mesh
    3. Traffic Control Config Entries
      1. Service Resolvers
      2. Service Splitters
      3. Service Routers
    4. Canary Deployments with Consul
      1. Deploying backend v2 on Kubernetes
      2. Deploying backend v2 on VMs
      3. Canary Deployment Continued
    5. Other Traffic Control Use Cases
    6. Summary
  12. 10. Advanced Use Cases
    1. Multi-cluster Federation
    2. Consul API Gateway
    3. Terminating Gateways
    4. HashiCorp Vault Integration
    5. Connect Native
    6. Network Infrastructure Automation
    7. Securing Consul
      1. ACLs
      2. Gossip Encryption
      3. Control Plane TLS
    8. Consul Enterprise
    9. HashiCorp Cloud Platform
    10. Amazon Elastic Container Service (ECS)
    11. Nomad
    12. Conclusion
  13. A. Common Errors
  14. Index
  15. About the Author

Product information

  • Title: Consul: Up and Running
  • Author(s): Luke Kysow
  • Release date: June 2022
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098106140