DevOps with Kubernetes: Accelerating software delivery with container orchestrators

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Leverage the power of Kubernetes to build an efficient software delivery pipeline.

Key Features

  • Learn about DevOps, containers, and Kubernetes all within one handy book
  • A practical guide to container management and orchestration
  • Learn how to monitor, log, and troubleshoot your Kubernetes applications

Book Description

Kubernetes has been widely adopted across public clouds and on-premise data centers. As we're living in an era of microservices, knowing how to use and manage Kubernetes is an essential skill for everyone in the IT industry.

This book is a guide to everything you need to know about Kubernetes―from simply deploying a container to administrating Kubernetes clusters wisely. You'll learn about DevOps fundamentals, as well as deploying a monolithic application as microservices and using Kubernetes to orchestrate them. You will then gain an insight into the Kubernetes network, extensions, authentication and authorization.

With the DevOps spirit in mind, you'll learn how to allocate resources to your application and prepare to scale them efficiently. Knowing the status and activity of the application and clusters is crucial, so we'll learn about monitoring and logging in Kubernetes. Having an improved ability to observe your services means that you will be able to build a continuous delivery pipeline with confidence. At the end of the book, you'll learn how to run managed Kubernetes services on three top cloud providers: Google Cloud Platform, Amazon Web Services, and Microsoft Azure.

What you will learn

  • Learn fundamental and advanced DevOps skills and tools
  • Get a comprehensive understanding of containers
  • Dockerize an application
  • Administrate and manage Kubernetes cluster
  • Extend the cluster functionality with custom resources
  • Understand Kubernetes network and service mesh
  • Implement Kubernetes logging and monitoring
  • Manage Kubernetes services in Amazon Web Services, Google Cloud Platform,and Microsoft Azure

Who this book is for

This book is for anyone who wants to learn containerization and clustering in a practical way using Kubernetes. No prerequisite skills are required, however, essential DevOps skill and public/private Cloud knowledge will accelerate the reading speed. If you're advanced, you can get a deeper understanding of all the tools and technique described in the book.

Table of Contents

  1. Introduction to DevOps
  2. DevOps with Container
  3. Getting started with Kubernetes
  4. Managing Stateful workloads
  5. Cluster Administration and Extension
  6. Kubernetes Network
  7. Monitoring and Logging
  8. Resource Management and Scaling
  9. Continuous Delivery
  10. Kubernetes on AWS
  11. Kubernetes on GCP
  12. Kubernetes on Azure

Author(s): Hideto Saito, Hui-Chuan Chloe Lee, Cheng-Yang Wu
Edition: 2
Publisher: Packt Publishing
Year: 2019

Language: English
Commentary: true epub
Pages: 484

Cover
Title Page
Copyright and Credits
About Packt
Contributors
Table of Contents
Preface
Chapter 1: Introduction to DevOps
Software delivery challenges
Waterfall and static delivery
Agile and digital delivery
Software delivery on the cloud
Continuous integration
Continuous delivery
Configuration management
Infrastructure as code
Orchestration
The microservices trend
Modular programming
Package management
The MVC design pattern
Monolithic applications
Remote procedure call
RESTful design
Microservices
Automation and tools
Continuous integration tools
Configuration management tools
Monitoring and logging tools
Communication tools
The public cloud
Summary
Chapter 2: DevOps with Containers
Understanding containers
Resource isolation
Linux containers
Containerized delivery
Getting started with containers
Installing Docker for Ubuntu
Installing Docker for CentOS
Installing Docker for macOS
The life cycle of a container
The basics of Docker
Layers, images, containers, and volumes
Distributing images
Connecting containers
Working with a Dockerfile
Writing your first Dockerfile
The syntax of a Dockerfile
Organizing a Dockerfile
Multi-stage builds
Multi-container orchestration
Piling up containers
An overview of Docker compose
Composing containers
Summary
Chapter 3: Getting Started with Kubernetes
Understanding Kubernetes
Kubernetes components
Master components
API server (kube-apiserver)
Controller manager (kube-controller-manager)
etcd
Scheduler (kube-scheduler)
Node components
Kubelet
Proxy (kube-proxy)
Docker
The interaction between the Kubernetes master and nodes
Getting started with Kubernetes
Preparing the environment
kubectl
Kubernetes resources
Kubernetes objects
Namespaces
Name
Label and selector
Annotation
Pods
ReplicaSet
Deployments
Services
ClusterIP
NodePort
LoadBalancer
ExternalName (kube-dns version >= 1.7)
Service without selectors
Volumes
Secrets
Retrieving secrets via files
Retrieving secrets via environment variables
ConfigMap
Using ConfigMap via volume
Using ConfigMap via environment variables
Multi-container orchestration
Summary
Chapter 4: Managing Stateful Workloads
Kubernetes volume management
Container volume life cycle
Sharing volume between containers within a pod
Stateless and stateful applications
Kubernetes' persistent volume and dynamic provisioning
Abstracting the volume layer with a persistent volume claim
Dynamic provisioning and StorageClass
Problems with ephemeral and persistent volume settings
Replicating pods with a persistent volume using StatefulSet
Submitting Jobs to Kubernetes
Submitting a single Job to Kubernetes
Submitting a repeatable Job
Submitting a parallel Job
Scheduling running a Job using CronJob
Summary
Chapter 5: Cluster Administration and Extension
Kubernetes namespaces
Context
Creating a context
Switching the current context
Kubeconfig
Service account
Authentication and authorization
Authentication
Service account token authentication
User account authentication
Authorization
Role-based access control (RBAC)
Roles and ClusterRoles
RoleBinding and ClusterRoleBinding
Admission control
NamespaceLifecycle
LimitRanger
ServiceAccount
PersistentVolumeLabel
DefaultStorageClass
ResourceQuota
DefaultTolerationSeconds
PodNodeSelector
AlwaysPullImages
DenyEscalatingExec
Other admission controller plugins
Dynamic admission control
Admission webhook
Custom resources
Custom resources definition
Summary
Chapter 6: Kubernetes Network
Kubernetes networking
Docker networking
Container-to-container communications
Pod-to-pod communications
Pod communication within the same node
Pod communication across nodes
Pod-to-service communications
External-to-service communications
Ingress
Network policy
Service mesh
Summary
Chapter 7: Monitoring and Logging
Inspecting a container
The Kubernetes dashboard
Monitoring in Kubernetes
Monitoring applications
Monitoring infrastructure
Monitoring external dependencies
Monitoring containers
Monitoring Kubernetes
Getting monitoring essentials for Kubernetes
Hands-on monitoring
Getting to know Prometheus
Deploying Prometheus
Working with PromQL
Discovering targets in Kubernetes
Gathering data from Kubernetes
Visualizing metrics with Grafana
Logging events
Patterns of aggregating logs
Collecting logs with a logging agent per node
Running a sidecar container to forward written logs
Ingesting Kubernetes state events
Logging with Fluent Bit and Elasticsearch
Extracting metrics from logs
Incorporating data from Istio
The Istio adapter model
Configuring Istio for existing infrastructure
Mixer templates
Handler adapters
Rules
Summary
Chapter 8: Resource Management and Scaling
Scheduling workloads
Optimizing resource utilization
Resource types and allocations
Quality of Service (QoS) classes
Placing pods with constraints
Node selector
Affinity and anti-affinity
Node affinity
Inter-pod affinity
Prioritizing pods in scheduling
Elastically scaling
Horizontal pod autoscaler
Incorporating custom metrics
Managing cluster resources
Resource quotas of namespaces
Creating a ResourceQuota
Request pods with default compute resource limits
Node administration
Pod eviction
Taints and tolerations
Summary
Chapter 9: Continuous Delivery
Updating resources
Triggering updates
Managing rollouts
Updating DaemonSet and StatefulSet
DaemonSet
StatefulSet
Building a delivery pipeline
Choosing tools
End-to-end walk-through of the delivery pipeline
The steps explained
env
script
after_success
deploy
Gaining a deeper understanding of pods
Starting a pod
Liveness and readiness probes
Custom readiness gate
init containers
Terminating a pod
Handling SIGTERM
SIGTERM isn't sent to the application process
SIGTERM doesn't invoke the termination handler
Container life cycle hooks
Tackling pod disruptions
Summary
Chapter 10: Kubernetes on AWS
Introduction to AWS
Public cloud
API and infrastructure as code
AWS components
VPC and subnet
Internet gateways and NAT-GW
Security group
EC2 and EBS
ELB
Amazon EKS
Deep dive into AWS EKS
Launching the EKS control plane
Adding worker nodes
Cloud provider on EKS
Storage class
Load balancer
Internal load balancer
Internet-facing load balancer
Updating the Kubernetes version on EKS
Upgrading the Kubernetes master
Upgrading worker nodes
Summary
Chapter 11: Kubernetes on GCP
Introduction to GCP
GCP components
VPC
Subnets
Firewall rules
VM instances
Load balancing
Health check
Backend service
Creating a LoadBalancer
Persistent Disk
Google Kubernetes Engine (GKE)
Setting up your first Kubernetes cluster on GKE
Node pool
Multi-zone clusters
Cluster upgrade
Kubernetes cloud provider
StorageClass
L4 LoadBalancer
L7 LoadBalancer (ingress)
Summary
Chapter 12: Kubernetes on Azure
Introduction to Azure
Resource groups
Azure virtual network
Network security groups
Application security groups
Subnets
Azure virtual machines
Storage account
Load balancers
Azure disks
Azure Kubernetes service
Setting up your first Kubernetes cluster on AKS
Node pools
Cluster upgrade
Monitoring and logging
Kubernetes cloud provider
Role-based access control
StorageClass
L4 LoadBalancer
Ingress controller
Summary
Other Books You May Enjoy
Index