Kubernetes---启动及退出动作

 

apiVersion: v1 
kind: Pod 
metadata:
  name: lifecycle-demo 
spec:
  containers:
  - name:lifecycle-demo-container 
    image: nginx 
    1ifecycle:
      poststart:  #启动时运行
        exec:
          command: ["/bin/sh","-c","echo Hello from the postStart handler> /usr/share/message"] 
      prestop:  #退出时运行
        exec: 
          command: ["/bin/sh","-c","echo Hello from the poststop handler> /usr/share/message"]

 

posted @ 2019-09-20 17:03  SpringCore  阅读(1373)  评论(0编辑  收藏  举报