Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 9872f2d6 authored by Marc Beninca's avatar Marc Beninca
Browse files

kube/cronjobs

parent ad670c36
No related branches found
No related tags found
No related merge requests found
**********
Kubernetes
kubernetes
**********
* Deployment → ReplicaSet → Pods → Containers
......@@ -279,3 +279,63 @@ Write
delete job my-job \
cascade=false \
-n my-namespace
CronJobs
========
Read
----
.. code:: shell
kubectl \
get cronjobs \
-n my-namespace
Write
-----
.. code:: shell
kubectl \
create cronjob my-cronjob \
--image my-image \
--schedule '*/4 * * * *' \
-n my-namespace
.. code:: yaml
apiVersion: batch/v1
kind: CronJob
metadata:
name: my-cronjob
spec:
schedule: '*/4 * * * *'
jobTemplate:
spec:
template:
spec:
containers:
- name: my-container
image: my-image
imagePullPolicy: IfNotPresent
command:
- /usr/bin/bash
- -c
- command
failedHistoryLimit: 2
successfulJobsHistoryLimit: 1
restartPolicy: OnFailure
.. code:: shell
kubectl \
patch cronjob my-cronjob \
-p '{"spec":{"schedule": "*/4 * * * *"}}' \
-n my-namespace
.. code:: shell
kubectl \
delete cronjob my-cronjob \
-n my-namespace
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment