Skip to content
Setup Kubernetes Federation v2 on AWS.
Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ap-northeast Remove unnecessary file Jun 14, 2019
img Update README.md Apr 25, 2019
patches Fix typo Jun 14, 2019
us-east Use kops config to deploy cluster Apr 24, 2019
us-west
.env.sample Use kops config to deploy cluster Apr 24, 2019
.gitignore init Apr 19, 2018
0-create-hosted-domain.sh
1-create-clusters.sh
10-create-nginx-fsvc.sh Update federation to support v0.1.0 May 24, 2019
11-deploy-external-dns.sh Update federation to support v0.1.0 May 24, 2019
12-create-nginx-domain-and-record.sh Update federation to support v0.1.0 May 24, 2019
13-create-nginx2-fdeploy.sh Update federation to support v0.1.0 May 24, 2019
14-create-nginx2-rsp.sh Update federation to support v0.1.0 May 24, 2019
2-init-helm.sh Bump to federation v2 Apr 23, 2019
3-install-federation.sh
4-join-ap-northeast.sh Update federation to support v0.1.0 May 24, 2019
5-join-us-east.sh Update federation to support v0.1.0 May 24, 2019
6-join-us-west.sh Update federation to support v0.1.0 May 24, 2019
7-create-fns.sh Update federation to support v0.1.0 May 24, 2019
8-create-nginx-fdeploy.sh
9-patch-nginx-pod.sh
99-purge.sh
README.md Update federation to support v0.1.0 May 24, 2019
dns-record.json init Apr 19, 2018

README.md

Setup Kubernetes Federation V2 on AWS

In 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.

Prerequisites

  • We need to deploy Kubernetes cluster in different AWS regions. e.g.:

    • US West: Oregon(us-west-2)
    • US East: Ohio(us-east-2)
    • Asia: Tokyo(ap-northeast-1)
  • Install the following tools on the host:

    • kubectl: Using kubectl, you can inspect cluster resources; create, delete, and update components.
    • helm: Using helm to install federation-v2 components by the chart.
    • kubefedctl: Helps you to join/unjon clusters from an existing federation control plane.
    • kops: Production Grade K8s Installation, Upgrades, and Management.

    Federation v2 can be deployed to and manage clusters running Kubernetes v1.11 or greater.

    • aws: The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services.
  • We will be using Amazon AWS as the IaaS provider:

    • IAM: Provide identity and access management.
    • EC2: The Kubernetes cluster instances.
    • ELB: Kubernetes service load balancer.
    • Route53: Public domain for Kubernetes API, Service, ..., etc.
    • S3: Store Kops state.
    • VPC: Provide cluster network.
  • Godaddy domain name or register from Route53

Quick Start

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.

You can’t perform that action at this time.