Mastering Kubernetes
eBook - ePub

Mastering Kubernetes

Gigi Sayfan

Share book
  1. 426 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Kubernetes

Gigi Sayfan

Book details
Book preview
Table of contents
Citations

About This Book

Master the art of container management utilizing the power of Kubernetes.About This Book• This practical guide demystifies Kubernetes and ensures that your clusters are always available, scalable, and up to date• Discover new features such as autoscaling, rolling updates, resource quotas, and cluster size• Master the skills of designing and deploying large clusters on various cloud platforms Who This Book Is ForThe book is for system administrators and developers who have intermediate level of knowledge with Kubernetes and are now waiting to master its advanced features. You should also have basic networking knowledge. This advanced-level book provides a pathway to master Kubernetes.What You Will Learn• Architect a robust Kubernetes cluster for long-time operation• Discover the advantages of running Kubernetes on GCE, AWS, Azure, and bare metal• See the identity model of Kubernetes and options for cluster federation• Monitor and troubleshoot Kubernetes clusters and run a highly available Kubernetes• Create and configure custom Kubernetes resources and use third-party resources in your automation workflows• Discover the art of running complex stateful applications in your container environment• Deliver applications as standard packagesIn DetailKubernetes is an open source system to automate the deployment, scaling, and management of containerized applications. If you are running more than just a few containers or want automated management of your containers, you need Kubernetes.This book mainly focuses on the advanced management of Kubernetes clusters. It covers problems that arise when you start using container orchestration in production. We start by giving you an overview of the guiding principles in Kubernetes design and show you the best practises in the fields of security, high availability, and cluster federation.You will discover how to run complex stateful microservices on Kubernetes including advanced features as horizontal pod autoscaling, rolling updates, resource quotas, and persistent storage back ends. Using real-world use cases, we explain the options for network configuration and provides guidelines on how to set up, operate, and troubleshoot various Kubernetes networking plugins. Finally, we cover custom resource development and utilization in automation and maintenance workflows.By the end of this book, you'll know everything you need to know to go from intermediate to advanced level.Style and approachDelving into the design of the Kubernetes platform, the reader will be exposed to the advanced features and best practices of Kubernetes. This book will be an advanced level book which will provide a pathway to master Kubernetes

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Mastering Kubernetes an online PDF/ePUB?
Yes, you can access Mastering Kubernetes by Gigi Sayfan in PDF and/or ePUB format, as well as other popular books in Computer Science & System Administration. We have over one million books available in our catalogue for you to explore.

Information

Year
2017
ISBN
9781786469854
Edition
1

Mastering Kubernetes


Table of Contents

Mastering Kubernetes
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Customer Feedback
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the color images of this book
Errata
Piracy
Questions
1. Understanding Kubernetes Architecture
Understanding container orchestration
Physical machines, virtual machines, and containers
Containers in the cloud
Cattle versus pets
Kubernetes concepts
Cluster
Node
Master
Pod
Label
Annotation
Label selector
Replication controller and replica set
Service
Volume
StatefulSet
Secret
Name
Namespace
Diving into Kubernetes architecture in depth
Distributed systems design patterns
Sidecar pattern
Ambassador pattern
Adapter pattern
Multi-node patterns
The Kubernetes APIs
Kubernetes API
Autoscaling API
Batch API
Kubernetes components
Master components
API server
Etcd
Controller manager
Scheduler
DNS
Node components
Proxy
Kubelet
Kubernetes runtimes
The runtime interface
Docker
Rkt
App container
Rktnetes
Is rkt ready for production usage?
Hyper containers
Hypernetes
Continuous integration and deployment
What is a CI/CD pipeline?
Designing a CI/CD pipeline for Kubernetes
Summary
2. Creating Kubernetes Clusters
Quick single-node cluster with Minikube
Getting ready
Creating the cluster
Troubleshooting
Checking out the cluster
Doing work
Examining the cluster with the dashboard
Creating a multi-node cluster using kubeadm
Getting ready
Preparing a cluster of vagrant VMs
Installing the required software
The hosts file
The vars.yml file
The playbook.yml file
Creating the cluster
Initializing the master
Setting up the pod network
Adding the worker nodes
Creating clusters in the cloud (GCP, AWS, Azure)
The cloud-provider interface
GCP
AWS
Azure
Creating a bare-metal cluster from scratch
Use cases for bare-metal
When should you consider creating a bare-metal cluster?
The process
Using virtual private cloud infrastructure
Summary
3. Monitoring, Logging, and Troubleshooting
Monitoring Kubernetes with Heapster
cAdvisor
InfluxDB backend
The storage schema
CPU
Filesystem
Memory
Network
Uptime
Grafana visualization
Performance analysis with the dashboard
Top-level view
Admin view
Workloads
Services and discovery
Adding central logging
Planning central logging
Fluentd
Elasticsearch
Kibana
Detecting node problems
Node problem detector
DaemonSet
Problem Daemons
Troubleshooting scenarios
Designing robust systems
Hardware failure
Quotas, shares, and limits
Bad configuration
Cost versus performance
Managing cost on the cloud
Managing cost on bare metal
Managing cost on hybrid clusters
Summary
4. High Availability and Reliability
High-availability concepts
Redundancy
Hot swapping
Leader election
Smart load balancing
Idempotency
Self-healing
High-availability best practices
Creating highly available clusters
Making your nodes reliable
Protecting your cluster state
Clustering etcd
Static discovery
Etcd discovery
DNS discovery
The etcd.yaml file
Verifying the etcd cluster
etcd 2 versus etcd 3
Protecting your data
Running redundant API servers
Running leader election with Kubernetes
Leader election for your application
Making your staging environment highly available
Testing high-availability
Live cluster upgrades
Rolling upgrades
Complex deployments
Blue-green upgrades
Managing data-contract changes
Migrating data
Deprecating APIs
Large-cluster performance, cost, and design trade-offs
Availability requirements
Best effort
Maintenance windows
Quick recovery
Zero-downtime
Performance and data consistency
Summary
5. Configuring Kubernetes Security, Limits, and Accounts
Understanding Kubernetes security challenges
Node challenges
Network challenges
Image challenges
Configuration and deployment challenges
Pod and container challenges
Organisational, cultural, and process challenges
Hardening Kubernetes
Understanding service accounts in Kubernetes
How does Kubernetes manage service accounts?
Accessing the API server
Authenticating users
Authorizing requests
Using admission control plugins
Securing pods
Using a private image repository
ImagePullSecrets
Specifying a security context
Protecting your cluster with AppArmor
Requirements
Securing a pod with AppArmor
Writing AppArmor profiles
Pod security policies
Managing network policies
Choosing a supported networking solution
Defining a network policy
Using secrets
Storing secrets in Kubernetes
Creating secrets
Decoding secrets
Using secrets in a container
Running a multi-user cluster
The case for a multi-user cluster
Using namespaces for safe multi-tenancy
Avoiding namespace pitfalls
Summary
6. Using Critical Kubernetes Resources
Designing the Hue platform
Defining the scope of Hue
Hue components
User profile
User graph
Identity
Authorizer
External service
Generic sensor
Generic actuator
User learner
Hue microservices
Plugins
Data stores
Stateless microservices
Queue-based interactions
Planning workflows
Automatic workflows
Human workfl...

Table of contents