k8s-启动、退出动作
时间:2019-12-06 16:13:41
收藏:0
阅读:1271
vim post.yaml
1 apiVersion: v1 2 kind: Pod 3 metadata: 4 name: lifecycle-demo 5 spec: 6 containers: 7 - name: lifecycle-demo-container 8 image: nginx 9 lifecycle: 10 postStart: 11 exec: 12 command: ["/bin/sh","-c","echo Hello from the postStart handler > /usr/share/message"] 13 preStop: 14 exec: 15 command: ["/bin/sh","-c","echo Hello from the postStop handler >> /usr/share/message"]
原文:https://www.cnblogs.com/BachrRR/p/11995856.html
评论(0)