Skip to content

Latest commit

 

History

History
94 lines (54 loc) · 1.73 KB

README.md

File metadata and controls

94 lines (54 loc) · 1.73 KB

Launch EKS/ECS by CDK

Automated provisoning EKS or ECS cluster, worker nodes are managed by Auto Scaling group and made up with On-Demand and Spot instances.

Prerequisite

  1. Install AWS CLI

  2. Install AWS SDK

ECS

Blueprint

Configure environment

# choose you favorite cluster name
export IS_ECS=yes
export ECS_CLUSTER_NAME=my-ecs-cluster
export AWS_DEFAULT_REGION=#?#
export AWS_ACCESS_KEY_ID=#?#
export AWS_SECRET_ACCESS_KEY=#?#

Provision

npm run build
cdk deploy GoEcs

Ready to go

aws ecs  list-clusters

EKS

Blueprint

Configure environment

# choose you favorite cluster name
unset IS_ECS
export EKS_CLUSTER_NAME=my-eks-cluster
export EKS_STAGE_1=yes
export AWS_DEFAULT_REGION=#?#
export AWS_ACCESS_KEY_ID=#?#
export AWS_SECRET_ACCESS_KEY=#?#

Provision

npm run build
cdk deploy GoEks

Ready to go

sudo su -
kubectl get svc
kubectl get nodes

Note

When you create an Amazon EKS cluster, the IAM entity user or role, such as a federated user that creates the cluster, is automatically granted system:masters permissions in the cluster's RBAC configuration. To grant additional AWS users or roles the ability to interact with your cluster, you must edit the aws-auth ConfigMap within Kubernetes.

https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html https://stackoverflow.com/questions/50791303/kubectl-error-you-must-be-logged-in-to-the-server-unauthorized-when-accessing