148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}

marco.cirilli
from marco.cirilli More from this publisher
19.06.2021 Views

CHAPTER 16Developing a Highly AvailableWebsiteIn Chapter 4 we used multiple AWS availability zones to provide fault tolerance for failure of a zone. But ahigh-availability master was not used, and the single master is a single point of failure. In Chapter 15 we diduse a high-availability master with OpenShift and Ansible, but the single elastic load balancer remains asingle point of failure.ProblemFor a high-availability website, multiple public DNSes need to be configured. Another problem is thatAmazon Elastic Load Balancers do not support Inter-AWS Region High-availability Architecture, in whichthe multiple master controllers in an HA master can be located in different AWS Regions. Amazon ElasticLoad Balancers only support Inter-AWS Zone High-availability Architecture within the same region. WhileAWS zones are in different physical locations and are insulated from each other (failure of a one zone doesnot cause failure in another zone), the HA is not spread across a wider geographical region.SolutionAmazon Route 53 provides DNS failover, using which a high-availability website may be developed. Route53 provides DNS failover across AWS regions as shown in Figure 16-1. Route 53 DNS failover can be usedto run applications across AWS zones or regions and configure alternate elastic load balancers to providefailover across zones or regions. Route 53 DNS failover is not a Kubernetes design pattern but makes use ofthe Amazon Route 53 Primary-Secondary architectural pattern.© Deepak Vohra 2017D. Vohra, Kubernetes Management Design Patterns, DOI 10.1007/978-1-4842-2598-1_16355

Chapter 16 ■ Developing a Highly Available WebsiteAmazonRoute53PublicHostedZoneAWSZoneus-east-1cAWSZoneus-west-2bPrimaryDNSSecondaryDNSFigure 16-1. Amazon Route 53 DNS failoverOverviewAmazon Route 53 is a highly available and scalable cloud domain name service (DNS) connecting userrequests to infrastructure running on the AWS, such as Amazon EC2 instances, load balancers, andAmazon S3 buckets. A Kubernetes cluster can be deployed using AWS CloudFormation, as discussed inChapter 4. But the cluster developed there, using the kube-aws CLI tool, was a single master cluster withoutthe provision of a failover. A highly available cluster has the tolerance for failure of a node in the clusterwith built-in failover to another node in the cluster. In this chapter we shall develop a highly availableKubernetes cluster using AWS CloudFormation on CoreOS. We shall provision multiple (three) AWSCloudFormations and subsequently host an example application (hello-world) Kubernetes Service oneach of the CloudFormations. We’ll use a public hosted zone for an example domain to route traffic to thatdomain. This chapter covers the following topics.Setting the environmentCreating CloudFormationsConfiguring external DNSCreating a Kubernetes serviceCreating an AWS Route 53Creating a hosted zoneConfiguring name serversCreating record setsTesting high availability356

CHAPTER 16

Developing a Highly Available

Website

In Chapter 4 we used multiple AWS availability zones to provide fault tolerance for failure of a zone. But a

high-availability master was not used, and the single master is a single point of failure. In Chapter 15 we did

use a high-availability master with OpenShift and Ansible, but the single elastic load balancer remains a

single point of failure.

Problem

For a high-availability website, multiple public DNSes need to be configured. Another problem is that

Amazon Elastic Load Balancers do not support Inter-AWS Region High-availability Architecture, in which

the multiple master controllers in an HA master can be located in different AWS Regions. Amazon Elastic

Load Balancers only support Inter-AWS Zone High-availability Architecture within the same region. While

AWS zones are in different physical locations and are insulated from each other (failure of a one zone does

not cause failure in another zone), the HA is not spread across a wider geographical region.

Solution

Amazon Route 53 provides DNS failover, using which a high-availability website may be developed. Route

53 provides DNS failover across AWS regions as shown in Figure 16-1. Route 53 DNS failover can be used

to run applications across AWS zones or regions and configure alternate elastic load balancers to provide

failover across zones or regions. Route 53 DNS failover is not a Kubernetes design pattern but makes use of

the Amazon Route 53 Primary-Secondary architectural pattern.

© Deepak Vohra 2017

D. Vohra, Kubernetes Management Design Patterns, DOI 10.1007/978-1-4842-2598-1_16

355

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!