

Adding preStopHook 优雅关闭容器 
terminationGracePeriodSeconds: 45
Kubernetes yamlfile
apiVersion: apps/v1kind: Deploymentmetadata:name: gracefulshutdown-appspec:replicas: 3selector:matchLabels:app: gracefulshutdown-apptemplate:metadata:labels:app: gracefulshutdown-appspec:containers:- name: graceful-shutdown-testimage: gracefulshutdown-app:latestports:- containerPort: 8080lifecycle:preStop:exec:command: ["sh", "-c", "sleep 10"] #set prestop hookterminationGracePeriodSeconds: 45 # terminationGracePeriodSeconds
https://yashwanth-nimmala.medium.com/kubernetes-graceful-shutdown-73bb23af2abd
