Questions tagged [kubernetes-cronjob]

301 questions
3
votes
2 answers

how to convert kubernetes deployment job into a kubernetes cron job using HELM Chart

i am running my spring boot application docker image on Kubernetes using Helm chart. Below is the details of the same templates/deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "xyz.fullname" . }} labels: {{-…
Sanjay Naik
  • 264
  • 1
  • 4
  • 23
3
votes
3 answers

Unable to create a cronjob in k8s

I am trying to create a cronjob , I have written a Springboot application for this and have created a abc-dev.yml file for application configuration error: unable to recognize "src/java/k8s/abc-dev.yml": no matches for kind "CronJob" in version…
lucky
  • 331
  • 6
  • 14
3
votes
3 answers

how to have only one Pod created for/by Cronjob

I am running this Cronjob at 2 AM in the morning: apiVersion: batch/v1beta1 kind: CronJob metadata: name: postgres-backup spec: # Backup the database every day at 2AM schedule: "0 2 * * *" jobTemplate: spec: template: …
f.bele
  • 207
  • 2
  • 13
3
votes
2 answers

How do I get a kubernetes cronjob to retry?

I have cronjob where the pod it starts ends up in ImagePullBackOff and the cronjob never scheduled another pod , though it has to per schedule. Is there a way to force the cron controller to schedule another pod even though the previous one ended…
user2062360
  • 1,323
  • 5
  • 16
  • 29
3
votes
1 answer

When cronjobs are set to replace, does Kubernetes wait for the previous job to finish shutting down before starting the new one?

Just as the question says, I'm just looking to know if Kubernetes waits for some kind of confirmation from the previous cronjob that it has completely stopped before starting the new one, or if the kill signal is sent and the new job is started at…
Chris Morgan
  • 85
  • 1
  • 6
3
votes
1 answer

How to run kubernetes cronjob immediately

Im very new to kubernetes ,here i tired a cronjob yaml in which the pods are created at every 1 minute. apiVersion: batch/v1beta1 kind: CronJob metadata: name: hello spec: schedule: "*/1 * * * *" jobTemplate: spec: template: …
june alex
  • 244
  • 4
  • 17
3
votes
3 answers

Cannot Remove all evicted pods in all Kubernetes namespaces Cronjob

My Kubernetes cluster has memory pressure limits that I need to fix (at a later time). There are sometimes anywhere from a few evicted pods to dozens. I created a Cronjob spec for clearing up the evicted pods. I tested the command inside and it…
3
votes
1 answer

Pass in Dynamic Formatted Datetime to K8s Container Config

I have a CronJob that runs a process in a container in Kubernetes. This process takes in a time window that is defined by a --since and --until flag. This time window needs to be defined at container start time (when the cron is triggered) and is a…
northsideknight
  • 1,519
  • 1
  • 15
  • 24
3
votes
1 answer

Is it possible to pass Kubernetes Cronjob status.lastScheduleTime timestamp to the container of scheduled job?

I have a cronjob that should process events occurred since the last operation, for that I use DB to persist this timestamp, my question is whether or not it is possible to directly pass Kubernetes status.lastScheduleTime into the cronjob object as…
Monem
  • 255
  • 2
  • 15
3
votes
2 answers

How do I stop a CronJob from recreating failed Jobs?

When for whatever reasons I delete the pod running the Job that was started by a CronJob, I immediately see a new pod being created. It is only once I delete something like six times the backoffLimit number of pods, that new ones stop being…
LLlAMnYP
  • 223
  • 3
  • 11
3
votes
2 answers

How Can I set Kubernetes Cronjob to run at a specific time

When I set the Cronjob Schedule as */1 * * * *,it would work. When I set any number which is in 0-59 to the crontab minute,such as 30 * * * *,it would work as well. However when I set the Cronjob Schedule as 30 11 * * *,it even doesn`t create a job…
cong
  • 51
  • 1
  • 5
2
votes
2 answers

Why is the pod status for my Kubernetes job not "Failed" when I purposefully ran a command to exit with a non-zero exit code?

I am running a CronJob on Kubernetes (version 1.20). These are the relevant details: concurrencyPolicy: Forbid backoffLimit: 6 - command: - /bin/bash - -c - | exit 1; restartPolicy: OnFailure When I run the job, the pod that spins up…
2
votes
0 answers

Kubernetes CronJob - Prometheus alerts

I am trying to figure out how to create Prometheus alerts for my kubernetes cronjob for the following scenarios using kube-state-metrics. If my cronjob fails, send an alert, after a minute if it's still failing or another failed cronjob exists,…
2
votes
1 answer

I want to create a crone in cluster which should have access to all of namespaces

I want to create a crone in the cluster which should have access to all of the namespaces, I don't want to configure that job in each and every namespace as I have multiple namespaces. Is this possible? Edit: I want to run same cronjob in all…
2
votes
3 answers

Terminate istio-proxy after cronjob completion

I have a k8s cronjob run my docker image transaction-service. It starts and gets its job done successfully. When it's over, I expect the pod to terminate but... istio-proxy still lingers there: And that results in: Nothing too crazy, but I'd like…
Fabio B.
  • 9,138
  • 25
  • 105
  • 177