Questions tagged [kubernetes-cronjob]
301 questions
5
votes
1 answer
Is there an efficient way to create a mechanism for automatic updating osrm map data in kubernetes?
We have created .yaml file to deploy osrm/osrm-backend (https://hub.docker.com/r/osrm/osrm-backend/tags) in a Kubernetes cluster.
We initially download the pbf file in the node's volume, then we create the necessary files for the service and finally…

Antonis S
- 733
- 6
- 15
5
votes
0 answers
PHP CURL failed with Operation timeout in Kubernetes CronJob
I have a cronJob that runs at some time interval to download images from remote servers. I had alpine-php:7.2-fpm docker image. It works fine with some of the URLs. but it is failing with some URLs.
Here is the code for CURL
$fp =…

Kathak Dabhi
- 399
- 3
- 16
5
votes
5 answers
Kubernetes run cronjob in wrong time
I have a schedule:
schedule: "0 10,14,18 * * *", I'd like to run this job in 10:00 am, 2:00pm, 6:00pm.
Since I located at UTC+8 timezone, this cronjob looks like not run as I expected.
Anyway to add a config for timezone?

xring
- 727
- 2
- 8
- 29
4
votes
1 answer
K8s version 1.21 GKE autopilot - no kind "CronJob" is registered for version "batch/v1"
We are having a problem with installing CronJob using Helm chart on GKE Autopilot cluster.
(when we installing the same Helm chart on Standard GKE cluster with the same GKE version installation works perfectly )
GKE version- 1.21.5-gke.1302
My…

shirab
- 41
- 2
4
votes
1 answer
K8S Cronjob PVC cleanup
I have a situation where i'm trying to create a Kubernetes CronJob which does some data processing. While the processing is being performed, I need to use external storage to temporarily store the data (as it's too big for nodes themselves), so i…

hpdobrica
- 134
- 7
4
votes
2 answers
Manually trigger kubernetes cronjob fails
My k8s version:
kubectl version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.2", GitCommit:"8b5a19147530eaac9476b0ab82980b4088bbc1b2", GitTreeState:"clean", BuildDate:"2021-09-15T21:38:50Z", GoVersion:"go1.16.8",…

JBoy
- 5,398
- 13
- 61
- 101
4
votes
2 answers
Schedule a Kubernetes cronjob to run just once
How can I schedule a Kubernetes cron job to run at a specific time and just once?
(Or alternatively, a Kubernetes job which is not scheduled to run right away, but delayed for some amount of time – what is in some scheduling systems referred to as…

malthe
- 1,237
- 13
- 25
4
votes
2 answers
Prevent two jobs from running in parallel in Kubernetes
ATT: I dont know why, but sometimes one pod suddenly change status to Unknown, that's where the new pod starts
I'm using kubernetes in gcloud.
I built the yaml file for the cron job that I need to run:
apiVersion: batch/v1beta1
kind:…

Matheus Epifanio
- 103
- 1
- 5
4
votes
0 answers
Kubernetes CronJob - Do ConcurrencyPolicy and manual job execution/creation communicate with one another?
I have a Kube cronjob that has a concurrencyPolicy of Replace. As I'd have expected, documentation suggests this means if there is a job running when the next cycle in the schedule is met while the previous job is running that the previous job would…

Dev-O
- 41
- 2
4
votes
2 answers
Is there a way to limit the number of running pods that are instances of a CronJob in Kubernetes?
I have configured a CronJon in K8S that creates a pod every 10 minutes.
The running container can complete in anything from 5 minutes to 2 hours, no way to tell.
Sometimes, when the computation is taking very long, i end up with far too many pods…

Ylli Prifti
- 323
- 3
- 11
4
votes
1 answer
How to run shell script using CronJobs in Kubernetes?
I am trying to run a shell script at regular interval of 1 minute using a CronJob.
I have created following Cron job in my openshift template:
- kind: CronJob
apiVersion: batch/v2alpha1
metadata:
name: "${APPLICATION_NAME}"
spec:
…

Harshit Goel
- 175
- 1
- 3
- 13
4
votes
3 answers
Can I add initContainers to a kubernetes-cronjob?
I want to have an initContainer that runs prior to the container my kubernetes cronjob is running. It's used to install kubectl. Is there a way of doing this?
I tried to add the initContainer-parameter to the cronjob.yaml file but it threw an…

Florian
- 123
- 1
- 9
4
votes
1 answer
Access scheduled run time inside Kubertes CronJob
I'm trying run a cron job with Kubernetes. The job executes a program that performs some computation based on the job's scheduled start time. How can my program get access to this value during its execution?

mway
- 615
- 5
- 14
4
votes
1 answer
Copy file from cron job's pod to local directory in AKS
I have created a cron job which runs every 60 min. In the job's container I have mounted emptyDir volume as detailed-logs. In my container I am writing a csv file at path detailed-logs\logs.csv.
I am trying to copy this file from pod to local…

Tarun
- 91
- 1
- 8
3
votes
0 answers
Why is my django-crontab cronjob not working?
I have a django-project with an app called app that has a file called cron.py with a function called my_job().
I want the my_job() function to be called every minute.
In my django-project/django-project/settings.py I have this:
INSTALLED_APPS = [
…

Anik Saha
- 97
- 6