We have flow which creates the cluster using "eksctl create cluster" command. Since it can take long time and the pod that is executing this command can die. Is there a way to know the cluster creation progress, so that the next steps after create cluster can be initiated?
I'm assuming this is being run as part of a CD process (eg Jenkins) and the executors/runners are pods which is why you need to verify the status of the stack.
The best way to check the status of the cluster stack is by using the stack name and the AWS CLI.
eksctl always creates a stack named eksctl-$CLUSTER_NAME-cluster
which you can use to query the cluster status. Replace $CLUSTER_NAME
with your actual cluster name. There are other stacks that get created (eg add ons, node groups) but that stack will tell you if the control plane is available.
You can wait for the stack to finish with the wait sub command. In your runner or script that executes you should put this command before the next step
aws cloudformation wait stack-create-complete --stack-name eksctl-$CLUSTER_NAME-cluster
This will poll the API every 30 seconds and once the stack has completed will exit 0. It will fail with an exit code 255 if the stack is not created in an hour (120 attempts).
When the stack has been created successfully your next step should execute automatically.