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"]

 

相关文章:

  • 2022-02-10
  • 2021-10-22
  • 2022-12-23
  • 2021-05-14
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2021-12-13
猜你喜欢
  • 2021-11-29
  • 2021-05-29
  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案