Questions tagged [kubernetes-jobs]

139 questions
1
vote
1 answer

Controll job deletions

We have a cronjob monitoring in our cluster. If a pod did not appear in 24 hours, It means that the cronjob haven't ran and we need to alert. But sometimes, due to some garbage collection, pod is deleted (but job completed successfully). How to keep…
1
vote
2 answers

JOB_COMPLETION_INDEX environment variable is empty when submitting an Indexed Job to kubernetes

I've made my cluster using minukube. as I know, Indexed-Job feature is added at kubernetes version 1.21. but when I made my job, it looks like there is no $JOB_COMPLETION_INDEX environ variable. here is my yaml apiVersion: batch/v1 kind:…
Seyoon
  • 115
  • 1
  • 7
1
vote
1 answer

Why is Kubernetes pod level "anti-affinity" is not being honored when creating pods in parallel?

So I'm not sure if I'm using this feature incorrectly or it's a limitation of "anti-affinity" but I'm at a loss. I have a batch of jobs that I want to run with each one having their own node. Should be relatively simple, add the anti-affinity to…
staticFlow
  • 141
  • 1
  • 2
  • 13
1
vote
1 answer

Kubernetes Pod Stuck in Pending Without Indicating Any Reason

We are using client-go to create kubernetes jobs and deployments. Today in one of our cluster (kubernetes v1.18.19), I encounter below weird problem. Pods of kubernetes Job are always stuck in Pending status, without any reasons. kubectl describe…
Wallace
  • 561
  • 2
  • 21
  • 54
1
vote
2 answers

Retrieve output from completed pod 'kubernetes'

How can i retrieve any directory/file from the completed pod of a particular job in kubernetes? I am trying to store the output file locally from the container.
0001000
  • 11
  • 3
1
vote
1 answer

Kubernetes - Helm not upgrading cron job

I have deployed many things with Helm into my Kubernetes cluster. My values.yaml file contains a lot of fields. The only modification I want to perform is add an additional environment variable to my cron job. (This cron job creates a pod where a…
1
vote
0 answers

How to see stdout of a pod in kubernetes job

I have a job in Kubernetes with a python script that is printing a tqdm progress bar to stdout (or stderr?). However, the progress bar cannot be seen with: kubectl logs test-qpgb7 # returns nothing kubectl logs -f test-qpgb7 # hangs and returns…
John Karasev
  • 151
  • 2
  • 11
1
vote
1 answer

Running bash script in a kubernetes pod

I am trying to run an external bash script using the below yaml file. The script is inside the /scripts/run.sh folder. I have also given the defaultMode: 0777 This is the error I get. sh: 0: Can't open /scripts/run.sh apiVersion: v1 data: …
jeril
  • 1,109
  • 2
  • 17
  • 35
1
vote
1 answer

Is there any way to print custom error message when kubernetes pre-install job fails?

I have a helm chart and the helm chart is only installed when the pre-install hooks is succeeded. When the job fails, the error is Error: failed pre-install: job failed: BackoffLimitExceeded Is there any way i can print my custom message that pops…
Darshil Shah
  • 447
  • 1
  • 11
  • 21
1
vote
0 answers

Delay in Kubernetes Job status update when running many jobs in parallel

I have a bit of a unique use-case where I want to run a large number (thousands to tens of thousands) of Kubernetes Jobs at once. Each job consists of a single container, Parallelism 1 and Completions 1, with no side-car or agent. My cluster has…
liltitus27
  • 1,670
  • 5
  • 29
  • 46
1
vote
2 answers

Kubernetes--How to trigger a job if configmap changes?

We have a scenario in our deployment process where an activity needs to be performed only once before the actual application containers are live and ready. This activity can not be placed as an init container because init container will be executed…
DD2607
  • 53
  • 1
  • 5
1
vote
1 answer

Finished pods created by Kubernetes CronJob getting deleted after sometime

I created a CronJob by using below yaml file. kind: CronJob metadata: name: $DEPLOY_NAME spec: # Run the job once a day at 8 PM schedule: "0 20 * * *" # If the previous job is not yet complete during the scheduled time, do not start the next…
Manish Bansal
  • 2,400
  • 2
  • 21
  • 37
1
vote
2 answers

Complete parallel Kubernetes job when one worker pod succeeds

I have a simple containerised python script which I am trying to parallelise with Kubernetes. This script guesses hashes until it finds a hashed value below a certain threshold. I am only interested in the first such value, so I wish to create a…
lemonzest
  • 11
  • 3
1
vote
3 answers

What is the right way to free up kubernetes resources for a kubernetes job that fails pulling the image?

Context We have long running kubernetes jobs based on docker containers. The containers needs resources (eg 15gb memory, 2 cpu) and we use autoscaler to scale up new worker nodes at request. Scenario Users can select the version of the docker image…
timv
  • 53
  • 6
1
vote
1 answer

Kubernetes helm for creating DB scripts for Database Conatiner

I am developing the Kubernetes helm for deploying the Python application. Within python application i have a Database that has to be connected. I want to run the Database scripts that would create db, create user, create table or any alter…