Kubernetes on AWS

Book description

Learn to implement container orchestration on AWS with ease

Key Features

  • Leverage the power of Kubernetes on AWS to deploy highly scalable applications
  • Provision Kubernetes clusters on Amazon EC2 environments
  • Implement best practices to improve efficiency and security of Kubernetes on the cloud

Book Description

Docker containers promise to radicalize the way developers and operations build, deploy, and manage applications running on the cloud. Kubernetes provides the orchestration tools you need to realize that promise in production.

Kubernetes on AWS guides you in deploying a production-ready Kubernetes cluster on the AWS platform. You will then discover how to utilize the power of Kubernetes, which is one of the fastest growing platforms for production-based container orchestration, to manage and update your applications. Kubernetes is becoming the go-to choice for production-grade deployments of cloud-native applications. This book covers Kubernetes from first principles. You will start by learning about Kubernetes' powerful abstractions - Pods and Services - that make managing container deployments easy. This will be followed by a guided tour through setting up a production-ready Kubernetes cluster on AWS, while learning the techniques you need to successfully deploy and manage your own applications.

By the end of the book, you will have gained plenty of hands-on experience with Kubernetes on Amazon Web Services. You will also have picked up some tips on deploying and managing applications, keeping your cluster and applications secure, and ensuring that your whole system is reliable and resilient to failure.

What you will learn

  • Learn how to provision a production-ready Kubernetes cluster on AWS
  • Deploy your own applications to Kubernetes with Helm
  • Discover strategies for troubleshooting your cluster and know where to find help with issues
  • Explore the best ways to monitor your cluster and the applications running on it
  • Supercharge your cluster by integrating it with the tools provided by the AWS platform
  • Architect your cluster for high availability

Who this book is for

If you're a cloud engineer, cloud solution provider, sysadmin, site reliability engineer, or developer with an interest in DevOps and are looking for an extensive guide to running Kubernetes in the AWS environment, this book is for you. Though any previous knowledge of Kubernetes is not expected, some experience with Linux and Docker containers would be a bonus.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Kubernetes on AWS
  3. Dedication
  4. About Packt
    1. Why subscribe?
    2. Packt.com
  5. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Conventions used
    4. Get in touch
      1. Reviews
  7. Google's Infrastructure for the Rest of Us
    1. Why do I need a Kubernetes cluster?
      1. The roots of containers
      2. Enter the container
        1. Cgroups
        2. Namespaces
        3. Putting the pieces together
      3. Here, schedule this...
      4. The basics of Kubernetes
        1. The pod
      5. Labeling all the things
      6. Replica sets
      7. Services
    2. Under the hood
      1. API server
      2. Controller manager
      3. Scheduler
      4. Kubelet
    3. Summary
  8. Start Your Engines
    1. Your own Kubernetes
      1. Installation
        1. macOS
        2. Linux
        3. Windows
      2. Starting Minikube
      3. First steps with kubectl
      4. Building Docker containers inside the cluster
    2. Building and launching a simple application on Minikube
      1. What just happened?
        1. Rolling out changes
        2. Resilience and scaling
      2. Using the dashboard
      3. Configuration as code
      4. Troubleshooting Minikube
    3. Summary
  9. Reach for the Cloud
    1. Cluster architecture
    2. Creating an AWS account
      1. Creating an IAM user
      2. Getting the CLI
      3. Setting up a key pair
      4. Preparing the network
    3. Setting up a bastion
      1. sshuttle
    4. Instance profiles
    5. Kubernetes software
      1. Docker
    6. Installing Kubeadm
      1. Building an AMI
    7. Bootstrapping the cluster
      1. What just happened?
    8. Access the API from your workstation
    9. Setting up pod networking
    10. Launching worker nodes
    11. Demo time
    12. Summary
  10. Managing Change in Your Applications
    1. Running pods directly
    2. Jobs
    3. CronJob
      1. Cron syntax
      2. Concurrency policy
      3. History limits
    4. Managing long running processes with deployments
      1. kubectl patch
      2. kubectl edit
      3. kubectl apply
      4. Kubernetes dashboard
      5. Greater control of your deployments
      6. RollingUpdate deployment
      7. Recreate deployment
    5. DaemonSet
    6. Summary
  11. Managing Complex Applications with Helm
    1. Installing Helm
      1. macOS
      2. Linux and Windows
      3. Installing Tiller
      4. Installing a chart
    2. Configuring a chart
    3. Creating your own charts
      1. Chart.yaml
      2. values.yaml
      3. templates
      4. Making it your own
      5. Developing and debugging
      6. Templating language
      7. Functions
      8. Flow control
    4. Hooks
    5. Packaging Helm charts
      1. You can test building an index
      2. Using your repository
    6. Organizational patterns for Helm
      1. Chart per application
      2. Shared charts
      3. Library charts
    7. Next steps
  12. Planning for Production
    1. The design process
      1. Initial planning
      2. Planning for success
      3. Planning for a successful roll out
    2. Discovering requirements
    3. Availability
    4. Capacity
      1. EC2 instance types
        1. EC2 instance types
        2. Breadth versus depth
    5. Performance
      1. Disk performance
        1. gp2
        2. io2
        3. st1
        4. sc1
      2. Networking
    6. Security
      1. Always be updating
        1. In-place updates
        2. Immutable images
      2. Network security
        1. Infra-node networking
      3. Node-master networking
        1. External networking
        2. Kubernetes infra-pod networking
      4. IAM roles
      5. Validation
    7. Observability
      1. Logging
      2. Monitoring
      3. Blackbox monitoring
      4. Alerting
      5. Tracing
    8. Summary
  13. A Production-Ready Cluster
    1. Building a cluster
    2. Getting started with Terraform
      1. Variables
      2. Networking
      3. Plan and apply
    3. Control Plane
    4. Preparing node images
      1. Installing Packer
      2. Packer configuration
    5. Node group
    6. Provisioning add-ons
    7. Managing change
    8. Summary
  14. Sorry My App Ate the Cluster
    1. Resource requests and limits
      1. Resource units
      2. How pods with resource limits are managed
      3. Quality of Service (QoS)
      4. Resource quotas
      5. Default limits
    2. Horizontal Pod Autoscaling
      1. Deploying the metrics server
      2. Verifying the metrics server and troubleshooting
      3. Autoscaling pods based on CPU usage
      4. Autoscaling pods based on other metrics
      5. Autoscaling the cluster
      6. Deploying the cluster autoscaler
    3. Summary
  15. Storing State
    1. Volumes
      1. EBS volumes
      2. Persistent volumes
        1. Persistent volumes example
    2. Storage classes
    3. StatefulSet
    4. Summary
    5. Further reading
  16. Managing Container Images
    1. Pushing Docker images to ECR
      1. Creating a repository
      2. Pushing and pulling images from your workstation
      3. Setting up privileges for pushing images
      4. Use images stored on ECR in Kubernetes
    2. Tagging images
      1. Version Control System (VCS) references
      2. Semantic versions
      3. Upstream version numbers
    3. Labelling images
    4. Summary
  17. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Kubernetes on AWS
  • Author(s): Ed Robinson
  • Release date: November 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781788390071