Create Cluster and Nodes on AWS - jamongx/twitter-clone GitHub Wiki

Create eksctl_role including the below 4 policy and save

  • AdministratorAccess
  • AmazonEC2FullAccess
  • AWSCloudFormationFullAccess
  • AMFullAccess
  • AWS -> IAM Dashboard -> Access management -> Role

Apply the created eksctl_role

  • EC2 -> K8s instance -> Action -> Security -> Modify IAM role

Create cluster and nodes

sample:
eksctl create cluster --name cluster-name  \
--region region-name \
--node-type instance-type \
--nodes-min 2 \
--nodes-max 2 \ 
--zones <AZ-1>,<AZ-2>


execute:
eksctl create cluster --name jamongx  \
--region us-east-2 \
--node-type t2.small \

cat /root/.kube/config

[root@ip-172-31-11-7 ~]# cat /root/.kube/config
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: 
    server: https://58C05B8C70E2059FBDDC91367EB8A22A.gr7.us-east-2.eks.amazonaws.com
  name: jamongx.us-east-2.eksctl.io
contexts:
- context:
    cluster: jamongx.us-east-2.eksctl.io
    user: [email protected]
  name: [email protected]
current-context: [email protected]
kind: Config
preferences: {}
users:
- name: [email protected]
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - eks
      - get-token
      - --output
      - json
      - --cluster-name
      - jamongx
      - --region
      - us-east-2
      command: aws
      env:
      - name: AWS_STS_REGIONAL_ENDPOINTS
        value: regional
      provideClusterInfo: false
[root@ip-172-31-11-7 ~]# 

Check the created cluster including eksctl_role from Stacks

  • AWS -> CloudFormation
  • The created cluster (work nodes)
⚠️ **GitHub.com Fallback** ⚠️