如何手动触发 Kubernetes 计划作业? [英] How can I trigger a Kubernetes Scheduled Job manually?

查看:45
本文介绍了如何手动触发 Kubernetes 计划作业?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 Kubernetes Scheduled Job,它每天运行两次一天按照它的日程安排.但是,我想手动触发它以进行测试.我该怎么做?

I've created a Kubernetes Scheduled Job, which runs twice a day according to its schedule. However, I would like to trigger it manually for testing purposes. How can I do this?

推荐答案

问题 #47538 提到的@jdf现已关闭,现在可以了.可以在此处找到原始实现,但语法已更改.

The issue #47538 that @jdf mentioned is now closed and this is now possible. The original implementation can be found here but the syntax has changed.

使用 kubectl v1.10.1+ 的命令是:

With kubectl v1.10.1+ the command is:

kubectl create job --from=cronjob/<工作名称>

它似乎向后兼容旧集群,因为它在 v0.8.x 上对我有用.

It seems to be backwardly compatible with older clusters as it worked for me on v0.8.x.

这篇关于如何手动触发 Kubernetes 计划作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆