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
- awscli
- kubectl
- heptio-authenticator-aws (check the section To install heptio-authenticator-aws for Amazon EKS)
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
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.
- 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
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
- All the following resources are based on the official AWS Documentation.
- K8S cheatsheet