简体   繁体   中英

Kubernetes AWS Fargate (EKS) continuously terminating pod hosting React service

I am using AWS EKS (managed Kubernetes service) and Fargate (managed nodes) to deploy a pod running a nodejs React service on port 5000. The pod switches from "Running" state to "Terminating" state continuously immediately after deployment to Fargate. Eventually, it settles on "Running". Other pods are running fine on Fargate.

I am unable to view the logs due to Kubernetes reporting net/http: TLS handshake timeout .

The service is fronted by AWS Application Load Balancer (ALB). In the target group, I can see continuous registration and deregistration of the pod/node IP.

How can I troubleshoot this further?

Some ways to troubleshoot:

  • With kubectl, if your pods are run with a K8s deployment:
     kubectl describe deployment <deployment-name> check for events
  • With kubectl, before the pod goes into Terminating
    kubectl logs <pod-id> kubectl describe pod <pod-id> check for events
  • Check EKS control plane logs in the S3 bucket where you are sending them to.

The idea is here is to troubleshoot with the Kubernetes tools.

It appears the React service was taking a long time to start due the compute allocation 0.25 vCPU and 0.5 GB, and eventually failing after 10 minutes. We set the following resource requests and limits in the deployment manifest. The pod starts within a couple of minutes without problems.

          resources:
            limits:
              cpu: 1000m
              memory: 2000Mi
            requests:
              cpu: 800m
              memory: 1500Mi

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM