Skip to content

monkeydaichan/eks-sample

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automated creation of EKS

Automate the process of Getting Started with Amazon EKS

Dependency

macOS Mojave kubectl AWS CLI

Usage

Start EKS

$ ./eks-start.sh

Deploy Dashboard

$ ./resource/dashboard/deploy.sh

Deploy sample application

$ ./resource/sample-application/deploy.sh

Delete sample application

$ ./resource/sample-application/delete.sh

Add iam user

Only the IAM user who created the EKS cluster can use the kubectl command.
To use the kubectlk command by another IAM user, you need to update the configmap.
Change the <ARN of the IAM user you want to add> and <Any name> of the prepare/config/configmap.yml file.

$ source env/env.sh

$ ROLE_ARN=$(aws cloudformation describe-stacks \
    --stack-name $EKS_WORKER_STACK_NAME \
    --query 'Stacks[0].Outputs[0].OutputValue' \
    | sed -E 's/.(.*)./\1/')

$ cat << EOT > prepare/config/configmap.yml
apiVersion: v1
kind: ConfigMap
metadata:
  name: aws-auth
  namespace: kube-system
data:
  mapRoles: |
    - rolearn: $ROLE_ARN
      username: system:node:{{EC2PrivateDNSName}}
      groups:
        - system:bootstrappers
        - system:nodes
  mapUsers: |
    - userarn: <The ARN of the IAM user you want to add>
      username: <Any name>
      groups:
        - system:masters

Deploy prepare/config/configmap.yml file.

$ kubectl apply -f prepare/config/configmap.yml

Delete EKS

$ ./all-delete.sh

License

Apache License 2.0

Authors

References

About

Automate the process of creation EKS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%