GithubHelp home page GithubHelp logo

weaveworks / kubernetes-ami Goto Github PK

View Code? Open in Web Editor NEW
41.0 51.0 15.0 45 KB

A simple AMI and CloudFormation for launching Kubernetes on AWS

License: Apache License 2.0

Shell 100.00%
kubernetes kubernetes-cluster kubernetes-setup cloudformation aws-cloudformation aws aws-ec2

kubernetes-ami's Introduction

Get Started with Kubernetes on AWS using CloudFormation

A simple CloudFormation template and AMI builder for running Kubernetes on AWS EC2.

The AMI is built with Packer and includes the Kubernetes packages for installation with kubeadm.

Launch Stack

Design

The CloudFormation template creates the following key components:

  • Kubernetes master EC2 instance
  • Auto Scaling Group for the Kubernetes minions
  • Security Group for Kubernetes & pod network comms

Parameters

Required parameters:

  • KubeCommunityAMI (AMI identifier)
  • KeyName (EC2 SSH key pair identifier)
  • NetworkAddon (Can be Weave or NONE, more to be added)

Optional parameters:

  • MasterInstanceType (default m4.large)
  • NodeInstanceType (default m4.xlarge)
  • Nodes (default 3)

Outputs

Once the cluster is running, you need to login to it!

  • MasterIP
  • LoginToMasterCommand
  • GetKubeconfigCommand

Manual Deployment Instructions

There are AMIs published in in all EC2 regions, please consult cloudformation.json for image IDs.

You will need to have an EC2 key in the region where you would like to deploy the cluster.

To create a stack, first clone this repo:

git clone https://github.com/weaveworks/kubernetes-ami
cd kubernetes-ami

Next, copy the command shown above and replace <YOUR_EC2_KEY_NAME> with the name of your SSH key in us-west-2 region.

aws cloudformation create-stack \
    --stack-name KubernetesGettingStarted \
    --region us-west-2 \
    --template-body "file://cloudformation.json" \
    --parameters \
      ParameterKey=KeyName,ParameterValue=<YOUR_EC2_KEY_NAME>

By default a 3-node cluster will be deployed, which takes a few minutes... You can run the following command to check the status of the stack.

> aws --region us-west-2 cloudformation describe-stacks --stack-name KubernetesGettingStarted
{
    "Stacks": [
        {
            "StackId": "arn:aws:cloudformation:us-west-2:992485676579:stack/KubernetesGettingStarted/802a0dad-ad8f-4273-b240-a0f313e1b288",
            "Description": "Getting Started with Kubernetes",
            "Parameters": [
                {
                    "ParameterValue": "<YOUR_EC2_KEY_NAME>",
                    "ParameterKey": "KeyName"
                },
                {
                    "ParameterValue": "m4.large",
                    "ParameterKey": "MasterInstanceType"
                },
                {
                    "ParameterValue": "m4.xlarge",
                    "ParameterKey": "NodeInstanceType"
                },
                {
                    "ParameterValue": "Weave",
                    "ParameterKey": "NetworkAddon"
                },
                {
                    "ParameterValue": "3",
                    "ParameterKey": "Nodes"
                }
            ],
            "Tags": [],
            "Outputs": [
                {
                    "OutputKey": "GetKubeconfigCommand",
                    "OutputValue": "scp -i <YOUR_EC2_KEY_NAME>.pem [email protected]:kubeconfig ./kubeconfig"
                },
                {
                    "OutputKey": "LoginToMasterCommand",
                    "OutputValue": "ssh -i <YOUR_EC2_KEY_NAME>.pem [email protected]"
                },
                {
                    "OutputKey": "MasterIP",
                    "OutputValue": "52.36.245.255"
                }
            ],
            "CreationTime": "2017-02-10T16:14:26.733Z",
            "StackName": "KubernetesGettingStarted",
            "NotificationARNs": [],
            "StackStatus": "CREATE_COMPLETE",
            "DisableRollback": false
        }
    ]
}

As you can see the Outputs section provides a few handy commands you can use to access the cluster.

Have fun using Kubernetes on AWS!

Getting Help

If you have any questions about, feedback for or problems with kubernetes-ami:

Your feedback is always welcome!

kubernetes-ami's People

Contributors

errordeveloper avatar pidster avatar rade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kubernetes-ami's Issues

Does not start the kubernetes API

Hi weaveworks!

I just wanted to clarify this repository https://github.com/weaveworks/kubernetes-ami does not do any kubeadm init, correct? It's a bit confusing because the README says "Have fun using Kubernetes on AWS!" as if it was ready to use! I think that after the deploy is done, we have a few machines running with the right packages, but we still need to run some commands to configure things and get some specific kubernetes processes running right?

Ingress

Right user can use node ports as the means of exposing their apps to the outside world, or kubectl port-forward for accessing them from their browser.
But it'd be nice if there existed an ingress controller, e.g. Traefik, run it on every node with ELB in front of it.

Add mapping for pod networks

Add a mapping so users can choose weave, calico, flannel and so on, internally selecting the correct URL for the kubectl apply -f $URL

it's possible for ec2metadata --public-ipv4 to return wrong address

I've reproduced this once, my API server ended-up advertising wrong address. I wonder if this is the case of a) bug in the metadata API – garbage address being returned; b) a race condition – address being return is valid at the time and is simply the one that we get EIP that we have asked for.

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.