Getting the instance-indentity document.
-
Created a VPC with 4 subnets, 2 public, 2 private, and did all the routing.
-
Created an EKS cluster with IAM and SG policies.
-
Created a group of managed nodes on spot instances
-
Made a screenshot of the curl command:
curl http://169.254.169.254/latest/dynamic/instance-identity/document
.
The program has been released with two states: VPC+EKS and Curl_pod (it is possible to use this state for multiple pods).
- Go to the eks folder and execute the following commands:
terragrunt plan
- required to download all necessary modules and establish a connection to S3+DynamoDB.
terragrunt apply --auto-approve
- apply the structure to the AWS account. - Go to the pods folder and run the same commands as above. This will help you create the curl pod.
- Then you need to update the configuration locally:
aws eks update-kubeconfig --region <your_region> --name <cluster_name>
and you can check the list of existing pods:kubectl get pods
. As a result you will see a curl pod. - You execute the command:
kubectl exec -it curl sh
to enter. And as a result you execute desired curl command inside (curl http://169.254.169.254/latest/dynamic/instance-identity/document
).