Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k8s 的小零碎 #334

Open
Bpazy opened this issue Oct 8, 2024 · 1 comment
Open

k8s 的小零碎 #334

Bpazy opened this issue Oct 8, 2024 · 1 comment

Comments

@Bpazy
Copy link
Owner

Bpazy commented Oct 8, 2024

记录一些 k8s 知识点

@Bpazy
Copy link
Owner Author

Bpazy commented Oct 8, 2024

手动运行 cronjob

kubectl create job --from=cronjob/<cronjob-name> <job-name> -n <namespace-name>

比如我有以下 cronjob:

ziyuan@pve-ubuntu:~/k8s$ kubectl get cronjob
NAME                          SCHEDULE    SUSPEND   ACTIVE   LAST SCHEDULE   AGE
backup-jenkins                0 3 * * *   False     0        13h             11d

则我可以通过下面命令立即创建 job 并运行:

kubectl create job --from=cronjob/backup-jenkins test-backup-jenkins

查看 job 状态:

ziyuan@pve-ubuntu:~/k8s$ kubectl get job
NAME                                   COMPLETIONS   DURATION   AGE
test-backup-jenkins            1/1           3s         3s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant