Code Monkey home page Code Monkey logo

aws-eks-cluster-controller's Introduction

CircleCI

AWS EKS Cluster Controller

The aws-eks-cluster-controller manages cross account EKS clusters and supported Kubernetes resources.

This controller is built using the kubebuilder framework. For more information read their docs

Concepts

  • Parent EKS Cluster: The Kubernetes cluster where this controller runs.
  • Child EKS Clusters: These are the Kubernetes clusters managed by the controller running in parent EKS cluster.

Turn Key Installation

Prerequisites

Make sure you have following tools installed on your workstation:

  1. aws-cli
  2. kubectl
  3. eksctl
  4. jq
  5. aws-iam-authenticator
  6. kubebuilder - install step

-- or on MacOS via brew --

brew tap weaveworks/tap/eksctl
brew install kustomize kubernetes-cli eksctl awscli jq
go get -u -v github.com/kubernetes-sigs/aws-iam-authenticator/cmd/aws-iam-authenticator

And install kubebuilder

IMPORTANT make sure your AWS user/role has sufficient permissions to use eksctl.

Setup Parent EKS cluster

  1. Create the Parent EKS cluster

    eksctl create cluster
  2. Once eksctl has finished, verify you can access the cluster.

    kubectl get nodes
  3. For this installation process we use kube2iam to manage IAM permissions for pods running on the parent cluster.

    kubectl apply -f deploy/kube2iam.yaml

Build and deploy the Controller

  1. Clone this project

    mkdir -p some/path
    cd some/path
    git clone [email protected]:awslabs/aws-eks-cluster-controller.git
  2. Create the IAM role that the controller will use

    export NODE_INSTANCE_ROLE_ARNS=`aws iam list-roles | jq -r --arg reg_exp "^eksctl-.*-NodeInstanceRole-.*$" '.Roles | map(select(.RoleName|test($reg_exp))) | map(.Arn) | join(",")'`; \
    
    aws cloudformation create-stack \
     --stack-name aws-eks-controller-role \
     --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM \
     --template-body file://config/setup/aws-eks-cluster-controller-role.yaml \
     --parameters \
       ParameterKey=WorkerArn,ParameterValue="'${NODE_INSTANCE_ROLE_ARNS}'"
    
    export IAMROLEARN=`aws iam get-role --role-name aws-eks-cluster-controller | jq -r .Role.Arn`
  3. Create repository and build/push image

    # Create ECR Repository
    aws ecr create-repository --repository-name aws-eks-cluster-controller
    export REPOSITORY=`aws ecr describe-repositories --repository-name aws-eks-cluster-controller | jq -r '.repositories[0].repositoryUri'`
    
    # Build/tag the docker image
    IMG=${REPOSITORY}:latest IAMROLEARN=${IAMROLEARN} make docker-build
    
    # Push the docker image
    aws ecr get-login --no-include-email | bash -
    docker push ${REPOSITORY}:latest
  4. Install required Kubernetes CustomResourceDefinitions (CRDs) and deploy controller

    make deploy

License

This library is licensed under the Apache 2.0 License.

aws-eks-cluster-controller's People

Contributors

anand99 avatar chkhd avatar ckrough avatar jpeddicord avatar madvikinggod avatar magizhchi avatar tantona avatar

Watchers

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