Tiếp theo, chúng ta cần xác minh kết nối để đảm bảo rằng container (Ứng dụng này được phát triển bởi bất kỳ ngôn ngữ lập trình nào như Java, Python, NodeJS …) đang chạy hay không, nó có thể kết nối với cơ sở dữ liệu rds và bộ đệm redis.
Có những danh mục chúng tôi cần xác minh để đảm bảo kết nối luôn khả dụng:
Bước 1: Download cặp key vừa tạo tại aws-resources/variables.tf
. đây là ssh_access_key variable
Bước 2: Sử dụng câu lệnh sau để ssh tới server
$ chmod 400 public-bastion-host.pem
$ ssh -i public-bastion-host.pem ec2-user@{Your Bastion Host IP}
Nếu bạn nhận được kết quả như ảnh bên dưới, bạn đã thành công SSH tới server.
Sau khi ssh thành công SSH tới bastion host, chúng ta cần cài đặt tool telnet để ping connect tới 3rd service. Cài đặt telnet tool tại Bastion Host sử dụng lệnh bên dưới:
sudo yum install telnet
Nếu bạn nhận được kết quả như ảnh bên dưới, bạn đã thành công cài đặt telnet tools
Nếu bạn không nhận được kết quả như ảnh trên, hãy kiểm tra NAT Gateway, Internet Gateway có thể cấu hình sai khiến EC2 không thể kết nối tới Internet để cài đặt tool.
Sử dụng lệnh bên dưới
telnet {host-aurora-postgres} {port-running}
If you received result below , you have connected to RDS Database from Bastion host
Or if you received result below, you haven’t connected to RDS Database, need to check Security Group, Inbound traffic from Bastion Host to RDS datbase
Using command below to ping
telnet {host-redis-cluster} {port-running}
If you received result below , you have connected to Redis Cache from Bastion host
Using command below to ping
telnet {host-eks-cluster} {port-running}
If you received result below , you have connected to Redis Cache from Bastion host
Now, we need to ssh to Worker Node to monitoring, troubleshoot issue
Step 1: Copy your pem file generate at 1. SSH to Bastion Host from Internet
to Bastion Host , using command below
vi public-basion-host.pem
Copy pem content file into this and using Ecs + wq
to save file
Step 2: we need to permission this file for only system can access, using command below
chmod 400 public-basion-host.pem
Step 3: Test ssh to Worker node using command below
ssh -i public-basion-host.pem ec2-user@{your-private-worker-node-ip}
As mentions, all resources need to avoid access from Internet, now we need ping connection from Worker Node to that resources, It’s ensure when new deployment have been deploy to kubernetes, which work fine, no any element loss connection to require resources.