Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nicor88/aws-k8s

Run kubernetes(k8s) inside AWS
https://github.com/nicor88/aws-k8s

aws cloudformation eks k8s k8s-monitoring terraform

Last synced: 18 days ago
JSON representation

Run kubernetes(k8s) inside AWS

Awesome Lists containing this project

README

        

# aws-k8s
Run kubernetes(k8s) inside AWS

There are multiple ways to run Kubernetes on AWS, one of this based on using [EKS](https://aws.amazon.com/eks/).

In this repository you can find multiple ways how deploy K8S based on EKS

## Requirements
* [awscli](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html)
* [kubectl](https://docs.aws.amazon.com/eks/latest/userguide/configure-kubectl.html)
* [heptio-authenticator-aws](https://docs.aws.amazon.com/eks/latest/userguide/configure-kubectl.html) (check the section **To install heptio-authenticator-aws for Amazon EKS**)

## Deployment with Cloudformation

Create all needed resources running


cd cloudformation
bash setup_all.sh

This command will setup:
* the Master Cloudformation stack containing EKS and all the needed Network resources
* the Worker Cloudformation stack containing an autoscaling group
* create a kubectl config file
* apply the node authentication to enable the EC2 machines to join K8S

## Deployment with Terraform


export AWS_PROFILE=your_profile
cd terraform
make init
make plan
make apply

After the deployment is done, you need to apply the `k8s/config_map.dist.yml`.
Run the following:


cp k8s/config_map.dist.yml k8s/config_map.yml

Be sure to replace `REPLACE_WITH_ARN_INSTANCE_PROFILE_ROLE` with the right role ARN.
Before applying the following yml file to the cluster, be sure to have `kubectl` installed and configured to the just created cluster.

## Setup Local config
* Install [awscli](https://docs.aws.amazon.com/cli/latest/userguide/install-macos.html)
* Run the following command:


export AWS_PROFILE=your_profile
aws eks update-kubeconfig --name nicor88-dev-k8s-cluster --kubeconfig ~/.kube/config_nicor88-dev-k8s-cluster
export KUBECONFIG=~/.kube/config_nicor88-dev-k8s-cluster

## Plugins
The folder **monitoring** includes all the needed configuration files to deploy a nice K8S Dashboard to check containers status.


kube apply -f plugins/monitoring/ --recursive

## Notes
* All the following resources are based on the official AWS Documentation.
* [K8S cheatsheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/)