华为云智能社区c
【摘要】 apiVersion: batch/v1kind: CronJobmetadata: name: date namespace: defaultspec: schedule: "* * * * *" jobTemplate: spec: template: spec: containers: - name: hello...
apiVersion: batch/v1
kind: CronJob
metadata:
name: date
namespace: default
spec:
schedule: "* * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox
command:
- "sh"
- "-c"
- "date"
restartPolicy: OnFailure
apiVersion: v1
kind: Pod
metadata:
name: lifecycle-demo
namespace: default
spec:
containers:
- name: nginx-container
image: nginx:latest
lifecycle:
postStart:
exec:
command: ["sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]
preStop:
exec:
command: ["sh", "-c", "nginx -s quit; while killall -0 nginx; do sleep 1; done"]
ports:
- containerPort: 80
【版权声明】本文为华为云社区用户原创内容,未经允许不得转载,如需转载请自行联系原作者进行授权。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)