Git Product home page Git Product logo

aws-k8s-federation's Introduction

Setup Kubernetes Federation on AWS

In this lab, we will deploy Kubernetes clusters in three different AWS regions, and then setup Kubernetes 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 will deploy clusters in different AWS regions:

    • 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.
    • kubefed: Helps you to deploy a new Kubernetes cluster federation control plane, and to add clusters to or remove clusters from an existing federation control plane.

    if OS is OS X, you need build from Federation source code.

    • kops: Production Grade K8s Installation, Upgrades, and Management.
    • 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.

aws-k8s-federation's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.