I am running my workload in EKS Cluster using Fargate node and it runs successfully but intermittently I see my fargate nodes are recreated from AWS so the Kubernetes statefulset and deployment running in fargate gets recreated which brings error in my application because my Kubernetes statefulset and deployment needs to be created in sequential manner but it’s not happening in this case therefore I want to understand why the fargate nodes which my application is using gets updated intermittently and how can I avoid this issue in future.
As of now to resolve the above issue i need to delete everything from my EKS Cluster and recreate it again.
Should I use managed node group instead of fargate?
Also, I am pulling image from dockerhub in my deployment and statefulset definition so could it be the case that my docker image gets updated then my pod also gets updated.
Should I pull docker image from ECR instead of docker hub in my Kubernetes statefulset and deployment?