Skip to content

nicor88/aws-k8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-k8s

Run kubernetes(k8s) inside AWS

There are multiple ways to run Kubernetes on AWS, one of this based on using EKS.

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

Requirements

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
  • 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