Reader small image

You're reading from  The Kubernetes Workshop

Product typeBook
Published inSep 2020
PublisherPackt
ISBN-139781838820756
Edition1st Edition
Right arrow
Authors (6):
Zachary Arnold
Zachary Arnold
author image
Zachary Arnold

Zachary Arnold works as a software engineer at Ygrene Energy Fund. Zach has an experience of over 10 years in modern web development. He is an active contributor to the Open Source Kubernetes project in both SIG-Release and SIG-Docs currently focusing on security. He has been running clusters in production since Kubernetes 1.7 and has spoken at the previous 4 KubeCons. His passion areas in the project center on building highly stable Kubernetes cluster components and running workloads securely inside of Kubernetes.
Read more about Zachary Arnold

Sahil Dua
Sahil Dua
author image
Sahil Dua

Sahil Dua is a software engineer. He started using Kubernetes to run machine learning workloads. Currently, he is running various types of applications on Kubernetes. He shared his learnings as a keynote session at KubeCon Europe 2018. He is a passionate open source contributor and has contributed to some famous projects such as Git, pandas, hound, go-GitHub, and so on. He has been an open source community leader for over 2 years at DuckDuckGo.
Read more about Sahil Dua

Wei Huang
Wei Huang
author image
Wei Huang

Wei Huang: Wei works as a senior software engineer in IBM. He has over 10 years' experiences around database, data warehouse tooling, cloud, container, monitoring and devops. He started to use Kubernetes since 1.3, including extending Kubernetes LoadBalancer using CRD, networking, scheduling and monitoring. Now he is a core maintainer of Kubernetes SIG-Scheduling.
Read more about Wei Huang

Faisal Masood
Faisal Masood
author image
Faisal Masood

Faisal Masood is a cloud transformation architect at AWS. Faisal's focus is to assist customers in refining and executing strategic business goals. Faisal main interests are evolutionary architectures, software development, ML lifecycle, CD and IaC. Faisal has over two decades of experience in software architecture and development.
Read more about Faisal Masood

Mélony Qin
Mélony Qin
author image
Mélony Qin

Mélony Y. QIN, also known as CloudMelon, is the founder of CloudMelon Vis, a tech media and educational platform for technopreneurs in the cloud-native and serverless space, and a former product manager at Microsoft. With a passion for cloud-native technologies, OSS, DevOps, Kubernetes, serverless, data, and AI, Mélony has authored multiple books, including the Certified Kubernetes Administrator (CKA) Exam Guide, the Kubernetes Workshop, and Microsoft Azure Infrastructure, all published by Packt Publishing. Mélony is a member of the Association for Computing Machinery (ACM) and the Project Management Institute (PMI), leveraging her extensive experience with diverse cloud technologies to drive innovation in the cloud-native, serverless, and generative AI space. She runs the CloudMelonVis YouTube channel and Cloud-Native Innovators newsletter, read by professionals from top tech companies such as Microsoft, Google, Amazon, Dell, and Carrefour.
Read more about Mélony Qin

Mohammed Abu Taleb
Mohammed Abu Taleb
author image
Mohammed Abu Taleb

Mohammed Abu-Taleb works as a Technical Advisor at Microsoft. Working at Microsoft CSS team for troubleshooting complex issues and cases for premier customers that are using Azure Kubernetes Services (AKS). Prior that, Mohammed was a SME (subject matter expert) for the azure managed monitoring service (Azure Monitor) focusing on designing, deploying, and troubleshooting monitoring strategies for containers.
Read more about Mohammed Abu Taleb

View More author details
Right arrow

11. Build Your Own HA Cluster

Overview

In this chapter, we will learn how Kubernetes enables us to deploy infrastructure with remarkable resilience and how to set up a high-availability Kubernetes cluster in the AWS cloud. This chapter will help you understand what enables Kubernetes to be used for highly available deployments and, in turn, enable you to make the right choices while architecting a production environment for your use case. By the end of the chapter, you will be able to set up a suitable cluster infrastructure on AWS to support your highly available (HA) Kubernetes cluster. You will also be able to deploy an application in a production environment.

Introduction

In the previous chapters, you learned about application containerization, how Kubernetes works, and some of the "proper nouns" or "objects" in Kubernetes that allow you to create a declarative-style application architecture that Kubernetes will execute on your behalf.

Software and hardware instability are a reality in all environments. As applications need higher and higher availability, shortcomings in the infrastructure become more obvious. Kubernetes was purpose-built to help solve this challenge for containerized applications. But what about Kubernetes itself? As cluster operators, do we shift from watching our individual servers like hawks to watching our single Kubernetes control infrastructure?

As it turns out, this aspect was one of the design considerations for Kubernetes. One of the design goals of Kubernetes is to be able to withstand instability in its own infrastructure. This means that when set up properly, the Kubernetes control...

How the Components of Kubernetes Work Together to Achieve High Availability

You have learned in Chapter 2, An Overview of Kubernetes, how the pieces of Kubernetes work together to provide a runtime for your application containers. But we need to investigate deeper how these components work together to achieve high availability. To do that, we'll start with the memory bank of Kubernetes, otherwise known as etcd.

etcd

As you have learned in earlier chapters, etcd is the place where all Kubernetes configuration is stored. This makes it arguably the single most important component of the cluster since changes in etcd affect the state of everything. More specifically, any change to a key-value pair in etcd will cause the other components of Kubernetes to react to this change, which could mean disruptions to your application. In order to achieve high availability for Kubernetes, it is wise to have more than one etcd node.

But many more challenges arise when you add multiple...

Building a High-Availability Focused Kubernetes Cluster

Hopefully, by reading the previous section, you're starting to realize that Kubernetes is less magical than it may seem when you first approached the topic. It is an extremely powerful tool on its own, but Kubernetes really shines when we take full advantage of its capability of running in a highly available configuration. So now we're going to see how to implement it and actually build a cluster using a cluster life cycle management tool. But before we do that, we need to know the different ways that we can deploy and manage a Kubernetes cluster.

Self-Managed versus Vendor-Managed Kubernetes Solutions

Amazon Web Services, Google Cloud Platform, Microsoft Azure, and practically every other major cloud services provider has a managed Kubernetes offering. So, when you are deciding how you are going to build and run your cluster, you should consider some of the different managed providers and their strategic offerings...

Summary

Highly available infrastructure is one of the key components to achieving high availability for applications. Kubernetes is an extremely well-designed tool and has many built-in resiliency features that make it able to withstand major networking and compute events. It works to keep those events from impacting your application. During our exploration of high-availability systems, we investigated some components of Kubernetes and how they work together to achieve high availability. Then, we constructed a cluster of our own on AWS that was designed to be highly available using the kops cluster life cycle management tool.

In the next chapter, we're going to take a look at how we make our applications more resilient by leveraging Kubernetes primitives to ensure high availability.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
The Kubernetes Workshop
Published in: Sep 2020Publisher: PacktISBN-13: 9781838820756
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Authors (6)

author image
Zachary Arnold

Zachary Arnold works as a software engineer at Ygrene Energy Fund. Zach has an experience of over 10 years in modern web development. He is an active contributor to the Open Source Kubernetes project in both SIG-Release and SIG-Docs currently focusing on security. He has been running clusters in production since Kubernetes 1.7 and has spoken at the previous 4 KubeCons. His passion areas in the project center on building highly stable Kubernetes cluster components and running workloads securely inside of Kubernetes.
Read more about Zachary Arnold

author image
Sahil Dua

Sahil Dua is a software engineer. He started using Kubernetes to run machine learning workloads. Currently, he is running various types of applications on Kubernetes. He shared his learnings as a keynote session at KubeCon Europe 2018. He is a passionate open source contributor and has contributed to some famous projects such as Git, pandas, hound, go-GitHub, and so on. He has been an open source community leader for over 2 years at DuckDuckGo.
Read more about Sahil Dua

author image
Wei Huang

Wei Huang: Wei works as a senior software engineer in IBM. He has over 10 years' experiences around database, data warehouse tooling, cloud, container, monitoring and devops. He started to use Kubernetes since 1.3, including extending Kubernetes LoadBalancer using CRD, networking, scheduling and monitoring. Now he is a core maintainer of Kubernetes SIG-Scheduling.
Read more about Wei Huang

author image
Faisal Masood

Faisal Masood is a cloud transformation architect at AWS. Faisal's focus is to assist customers in refining and executing strategic business goals. Faisal main interests are evolutionary architectures, software development, ML lifecycle, CD and IaC. Faisal has over two decades of experience in software architecture and development.
Read more about Faisal Masood

author image
Mélony Qin

Mélony Y. QIN, also known as CloudMelon, is the founder of CloudMelon Vis, a tech media and educational platform for technopreneurs in the cloud-native and serverless space, and a former product manager at Microsoft. With a passion for cloud-native technologies, OSS, DevOps, Kubernetes, serverless, data, and AI, Mélony has authored multiple books, including the Certified Kubernetes Administrator (CKA) Exam Guide, the Kubernetes Workshop, and Microsoft Azure Infrastructure, all published by Packt Publishing. Mélony is a member of the Association for Computing Machinery (ACM) and the Project Management Institute (PMI), leveraging her extensive experience with diverse cloud technologies to drive innovation in the cloud-native, serverless, and generative AI space. She runs the CloudMelonVis YouTube channel and Cloud-Native Innovators newsletter, read by professionals from top tech companies such as Microsoft, Google, Amazon, Dell, and Carrefour.
Read more about Mélony Qin

author image
Mohammed Abu Taleb

Mohammed Abu-Taleb works as a Technical Advisor at Microsoft. Working at Microsoft CSS team for troubleshooting complex issues and cases for premier customers that are using Azure Kubernetes Services (AKS). Prior that, Mohammed was a SME (subject matter expert) for the azure managed monitoring service (Azure Monitor) focusing on designing, deploying, and troubleshooting monitoring strategies for containers.
Read more about Mohammed Abu Taleb