Soufiane Aqajjef:
define the pod manifest run command uname in a single busybox:stable container. the command must run evry minute abd must complete within 22 seconds or be terminated by kubernetes. the cronjob name and container name must both be hello
Oliver Radwell:
this may help: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/
22 second deadline can be achieved with activeDeadlineSeconds
https://kubernetes.io/docs/concepts/workloads/controllers/job/
Tanumoy Ghosh:
-
Creating cronjob via imperative way
kubectl create cj hello --image busybox:stable --schedule "*/1 * * * *" --dry-run=client -o yaml -- /bin/sh -c 'uname' > hello-cj.yaml
-
Open hello-cj.yaml in vi editor to include
activeDeadlineSeconds: 22
in job spec -
kubectl create -f hello-cj.yaml
Soufiane Aqajjef:
thanks