Tạo EKS Cluster

Tạo EKS Cluster

  1. Để tạo EKS cluster, trước tiên chúng ta sẽ phải tạo SSH key để có thể access vào EC2 Node trong Cluster khi cần thiết:
aws ec2 create-key-pair --key-name k8s-demo --query 'KeyMaterial' --output text> k8s-demo.pem

Create EKS Cluster

  1. Trong giao diện AWS Console
  • Tìm EC2
  • Chọn EC2

Create EKS Cluster

  1. Trong giao diện EC2
  • Chọn Key Pair
  • Xem Key Pair vừa tạo

Create EKS Cluster

  1. Để tạo EKS Cluster và các EC2 Node chúng ta sử dụng command sau:
eksctl create cluster --name k8s-demo --region ap-southeast-1 --nodegroup-name k8s-demo --nodes 2 --ssh-access --ssh-public-key k8s-demo --managed
  • Khi bạn chạy command này, thì eksctl sẽ sử dụng AWS CloudFormation để tạo các infrastructure cần thiết và setup Master Node (Control Plane).

Create EKS Cluster

  1. Giao diện sau khi tạo EKS Cluster.

Create EKS Cluster

Mất khoảng 15 phút để hoàn thành quá trình khởi tạo EKS Cluster