k8s微服务平滑上下线改造步骤


1.网关拦截掉/actuator相关接口

2.服务pom加上jar包

  
    org.springframework.boot
    spring-boot-starter-actuator
  

3.健康接口使用/actuator/health

4.application.properties添加配置
management.endpoints.web.exposure.include=*
management.endpoint.shutdown.enabled=true
management.endpoint.health.show-details=always

5.k8s加上preStop执行命令
curl -X POST localhost:[端口]/actuator/shutdown