Mango milk 2021-02-23 15:57:15
k8s-cronjob cronjob



cron job -> (0-2)job -> pod
One CronJob Object similar to crontab (cron table) A line in a document . It periodically runs a Job
Cron Job During each scheduling run time Probably Will create a Job object . The reason why we say Probably , It's because in a particular environment, you might create two Job, Or a Job None of them were created . We're trying to reduce that , But it can't be completely avoided . therefore , establish Job The operation should be _ idempotent _.
Job Based on what it creates Pod Parallelism of , Responsible for creating Pod, And decided on this group Pod Success or failure of . Cron Job I'm not going to check at all Pod
-- see cronjob
kubectl get cronjob -n niuniu
kubectl get cronjob -n niuniu --watch
apiVersion: batch/v1beta1
kind: CronJob
namespace: niuniu
name: autocheckout
app: cron
schedule: "*/1 * * * *"
concurrencyPolicy: Allow
startingDeadlineSeconds: 300
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
.spec.startingDeadlineSeconds Fields are optional . It means start Job Time limit of ( Second level ), If the scheduled time is missed for any reason , So what's missing execution time Job Will be considered a failure . If not specified , There is no deadline
Concurrency strategy
.spec.concurrencyPolicy Fields are also optional . It specifies how to deal with being Cron Job Created Job Concurrent execution of . Only one of the following policies is allowed to be specified :
Allow( Default ): Allow concurrent runs Job
Forbid: Prohibit concurrent running , If the previous one hasn't been completed yet , Then skip the next one
Replace: Cancel the currently running Job, Replace... With a new one
Be careful , The current policy can only be applied to the same Cron Job Created Job. If there are multiple Cron Job, They were created Job Always allow concurrent runs between .
Hang up
.spec.suspend Fields are also optional . If set to true, All subsequent execution will be suspended . It's about what's already being done Job It doesn't work . The default value is false.
Job Historical limitations
.spec.successfulJobsHistoryLimit and .spec.failedJobsHistoryLimit
They specify that completion and failure can be retained Job The limit of quantity .
There are no restrictions by default , All the success and failure Job Will be preserved . However , When running a Cron Job when , It's going to pile up a lot soon Job, It is recommended to set the values of these two fields . Set the limit value to 0, Related types of Job It will not be retained after completion .
本文为[Mango milk ]所创,转载请带上原文链接,感谢

  1. Redis 日志篇:系统高可用的杀手锏
  2. Java中把一个对象的值复制给另外一个对象引发的思考
  3. Java serialization / call wildfly service interface exception: ejbclient000409
  4. Docker compose deploy stack
  5. Mac下查看已安装的jdk版本及其安装目录
  6. Redis log: the killer of system high availability
  7. mybatis映射xml配置文件报错:<statement> or DELIMITER expected, got ‘id‘
  8. Thinking about copying the value of one object to another in Java
  9. IntelliJ IDEA 还能画思维导图,果然最强 IDE!
  10. vue使用sdk进行七牛云上传
  11. IntelliJ IDEA 还能画思维导图,果然最强 IDE!
  12. Spring原来还可以这么玩!阿里新产Spring全线宝典成功颠覆了我对Spring的认知!
  13. View the installed JDK version and its installation directory under mac
  14. Error in mybatis mapping XML configuration file: < statement > or delay expected, got 'ID‘
  15. IntelliJ IDEA 还能画思维导图,果然最强 IDE!
  16. Javascript性能优化【内联缓存】 V8引擎特性
  17. IntelliJ idea can also draw mind maps. It's really the strongest ide!
  18. Vue uses SDK to upload Qi Niu cloud
  19. IntelliJ idea can also draw mind maps. It's really the strongest ide!
  20. 深入理解 Web 协议 (三):HTTP 2
  21. Spring can still play like this! Ali's new spring product has successfully overturned my understanding of spring!
  22. IntelliJ idea can also draw mind maps. It's really the strongest ide!
  23. JavaScript performance optimization [inline cache] V8 engine features
  24. linux 配置java环境
  25. linux find 查找文件
  26. 深入理解 Web 协议 (三):HTTP 2
  27. IntelliJ IDEA 相关问题记录
  28. Deep understanding of Web protocol (3): http 2
  29. 深入理解 Web 协议 (三):HTTP 2
  30. 腾讯IEG开源AI SDK:自动化测试吃鸡、MOBA类游戏
  31. Mysql Command
  32. Configuring Java environment with Linux
  33. Find files in Linux
  34. docker-Dockerfile 创建镜像
  35. Redis Cluster
  36. 深入理解 Web 协议 (三):HTTP 2
  37. JavaScriptBOM操作
  38. JavaScriptBOM操作
  39. Deep understanding of Web protocol (3): http 2
  40. Record of IntelliJ idea related problems
  41. Deep understanding of Web protocol (3): http 2
  42. Tencent IEG open source AI SDK: automatic testing of chicken eating and MoBa games
  43. Mysql Command
  44. Docker dockerfile create image
  45. Redis Cluster
  46. 死磕Spring之IoC篇 - 文章导读
  47. Deep understanding of Web protocol (3): http 2
  48. JavaScript BOM operation
  49. JavaScript BOM operation
  50. 死磕Spring之IoC篇 - 文章导读
  51. k8s node 操作与维护
  52. k8s 证书更新
  53. 【Java面试题第三期】JVM中哪些地方会出现内存溢出?出现的原因是什么?
  54. HashMap连环问你能答出几道?
  55. k8s-cronjob
  56. k8s-cert
  57. Spring: an introduction to IOC
  58. Spring: an introduction to IOC
  59. Operation and maintenance of k8s node
  60. K8s certificate update