Setup Kubernetes Federation v2 on AWS.
V2
on AWSIn this lab, we will deploy the Kubernetes cluster in three different AWS regions, and then setup Federation between clusters. When federation has been created we will create a federated deployment and service for NGINX. And finally, we will create latency-based DNS records in Route 53, one for each cluster region.
We need to deploy Kubernetes cluster in different AWS regions. e.g.:
Install the following tools on the host:
Federation v2 can be deployed to and manage clusters running Kubernetes
v1.11
or greater.
We will be using Amazon AWS as the IaaS provider:
Godaddy domain name or register from Route53
For the execution of the labs, you need set your env in .env
file:
$ cp .env.sample .env
$ vim .env
First create a hostedzone using 0-create-hosted-domain.sh
:
$ ./0-create-hosted-domain.sh
# output like this
{
"HostedZone": {
"ResourceRecordSetCount": 2,
"CallerReference": "2018-04-19-11:24",
"Config": {
"PrivateZone": false
},
"Id": "/hostedzone/Z363YQ27EUQU4S",
"Name": "k8s.xxxx.com."
},
"DelegationSet": {
"NameServers": [
"ns-431.awsdns-49.org",
"ns-1341.awsdns-00.com",
"ns-134.awsdns-42.co.uk",
"ns-1131.awsdns-62.net"
]
},
"Location": "https://route53.amazonaws.com/2013-04-01/hostedzone/Z363YQ27EUQU4S",
"ChangeInfo": {
"Status": "PENDING",
"SubmittedAt": "2018-04-19T03:24:17.638Z",
"Id": "/change/CTCT89X4F01LM"
}
}
$ aws route53 list-hosted-zones
Add NameServers
into Godaddy, like this:
Now follow the scripts to setup your federation cluster.