Questions tagged [kubernetes-cronjob]
301 questions
2
votes
2 answers
Trigger a Java REST endpoint upon S3 File Upload Event
I have a Spring Batch application which does followings,
A different application puts a csv file in a S3 bucket INBOUND
Spring Batch application reads a csv file
using data of each row, it calls an API endpoint and get a quote
Put those quotes in a…

samme4life
- 1,143
- 2
- 14
- 20
2
votes
1 answer
Kubernetes Cronjob triggers Job immediately even though the time exceeded
I have Kubernetes job which runs every day at 5 AM. Today I wanted to change it to 6 AM. My current time is 10 AM.
As soon as modified the time from 5 AM to 6 AM, I noticed that Kubernetes Cronjob immediately triggers the job even though my current…

karthikeayan
- 4,291
- 7
- 37
- 75
2
votes
1 answer
Schedule a Job using the same PVC's as 1 other Pod in a StatefulSet
In a Kubernetes cluster, I'd like to be able to schedule a Job (with a CronJob) that will mount the same Volumes as 1 Pod of a given StatefulSet. Which Pod that is is a run time decision, depending on the labels set on the Pod at the time of…

Feike Steenbergen
- 321
- 1
- 10
2
votes
1 answer
How can I filter in the kubernetes API (or kubectl) for Jobs owned by a given CronJob?
I have several CronJobs, and I want to be able to query for a list of completed jobs for a specific one. I tried --field-selector metadata.ownerReferences.uid but that's not a supported field selector for batchv1.job (Looking at this it appears…

Joe Ceresini
- 66
- 6
2
votes
2 answers
How to cleanup failed CronJob spawned Jobs once a more recent job passes
I am running management tasks using Kubernetes CronJobs and have Prometheus alerting on when one of the spawned Jobs fails using kube-state-metrics:
kube_job_status_failed{job="kube-state-metrics"} > 0
I want to have it so that when a more recent…

dippynark
- 2,743
- 20
- 58
2
votes
1 answer
Unable to create a MySQL database backup in GCP storage
We deploy a laravel project in k8s(GCP) with mysql database. Now i want time to time backup of this database with the help of cronjob and I followed an articles but i'm unable to create a backup file. However, as per article we need to create the…

Saya Kasta
- 160
- 1
- 9
2
votes
1 answer
Is there a way to filter metric by a string value a part of which comes from the result of another query in prometheus query?
I want to get an alert when the recent job of a cronjob fails. The expr
kube_job_status_failed{job_name=~"cronjobname.*"}==1 works for most of time. But if a job fails and it's kept, even the next job succeeds, I still get an alert because there are…

Aaron LUO
- 63
- 1
- 6
2
votes
1 answer
what is the issue with this cron job, its not running. how to debug it
I am using helm for k8s deployment and I need a cron job which will just access the url. I have written script and script works if I run it independently as a shell script task. Why the cron job is not able to run the script inside.
apiVersion:…

Vatan Soni
- 540
- 2
- 11
- 23
2
votes
1 answer
Does Kubernetes CronJob concurrencyPolicy works as expected?
Due to the Kubernetes docs
A cron job creates a job object about once per execution time of its schedule. We say “about” because there are certain circumstances where two jobs might be created, or no job might be created. We attempt to make these…

Dmitry
- 53
- 7
2
votes
1 answer
sharing data between a cronjob and pod
Right now I have a cronjob that downloads data and I want to share it to another container that does the processing for the data as new ones are uploaded. I wanted to know if there was a way without any external services to share this data between…

anon2156
- 21
- 4
2
votes
4 answers
CronJob: unknown field "configMapRef"
I'm applying a Kubernetes CronJob.
So far it works.
Now I want to add the environment variables. (env: -name... see below)
While tryng to apply I get the error
unknown field "configMapRef" in io.k8s.api.core.v1.EnvVarSource
I don't like to set…

Frank Mehlhop
- 1,480
- 4
- 25
- 48
2
votes
1 answer
Kubernetes Run job using CronJob
Is there a way through which I can run an existing Job using CronJob resource.
In CronJob Spec template can we apply a selector using labels. Something like this:
Job Spec: (Link to job docs)
apiVersion: batch/v1
kind: Job
label:
name: pi
spec:
…

Ankit Deshpande
- 3,476
- 1
- 29
- 42
1
vote
0 answers
PromQL alert error - Vector contains metrics with the same labelset after applying rule labels
I have setup a Cronjob for a container that exits with a non-zero code. I have a PrometheusRule and AlertManagerConfig setup against this CronJob but the alert is not firing as expected. The alerting is based on this example.
This is the CronJob…

Golide
- 835
- 3
- 13
- 36
1
vote
1 answer
Multi threading in AWS EKS
I'm using Spring Batch with a Kubernetes Cron Manager to schedule and run a job. The job involves calling an external API to read, process, and write data. However, when I execute the job with a dataset of 200,000 items, it takes an excessively long…

Faisal
- 11
- 3
1
vote
1 answer
Use ENV as variable in the secret name of a kubernetes manifest
I want to build the the secretName dynamically base on the value of the my-label key (trough a ENV). Is this possible?
I used the a similar approach to use label values as ARGs which worked.
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name:…

Christoph Lang
- 71
- 2