Questions tagged [kubernetes-jobs]

139 questions
5
votes
0 answers

'Kubernetes Jobs' in Docker Swarm

Docker Swarm is comparatively easier to maintain compared to Kubernetes so I was thinking of migrating from a Kubernetes cluster to a Docker Swarm cluster. In my Kubernetes cluster, I used Jobs extensively to spin up workers ad-hoc and is very…
Seng Wee
  • 534
  • 9
  • 20
5
votes
1 answer

How to find out if a K8s job failed or succeeded using kubectl?

I have a Kubernetes job that runs for some time, and I need to check if it failed or was successful. I am checking this periodically: kubectl describe job/myjob | grep "1 Succeeded" This works but I am concerned that a change in kubernetes can…
Greg Bala
  • 3,563
  • 7
  • 33
  • 43
4
votes
1 answer

Is there a way to enable shareProcessNamespace for helm post-install hook?

I'm running a pod with 3 containers (telegraf, fluentd and an in-house agent) that makes use of shareProcessNamespace: true. I've written a python script to fetch the initial config for telegraf and fluentd from a central controller API endpoint.…
3
votes
1 answer

How best, when a pod controlled by a job fails due to out of memory error, to increase the requested memory before rebooting the pod?

I was wondering if there are any ways to spin up another job, on the event that a pod controlled by a job fails, which would update the job controlling that pod’s memory request value, maybe double it, before the pod restarts? I’ve looked up PreStop…
Ryan
  • 451
  • 4
  • 11
3
votes
2 answers

How to find owner of cronjobs in Kubernetes and Kill it?

I have a cron job that continues to run though I have no deployments or jobs. I am running minikube: $ kubectl get deployments No resources found in default namespace. $ kubectl delete pods --all && kubectl delete jobs --all && get deployments pod…
Aaron
  • 3,249
  • 4
  • 35
  • 51
3
votes
1 answer

Kubernetes: when do i need to add /bin/sh -c to my command?

I am preparing for the CKAD exam and I am doing practice with the questions provide here I have a doubt over this two different way of executing commands. Here the example provided is with a job but I think the question might be more general and…
Cr4zyTun4
  • 625
  • 7
  • 18
3
votes
1 answer

Manually change the status of a job to successful in kubernetes

For some troubleshooting, I need to manually change the status of a running job from active to successful to make it completed. The job itself is an infinite loop that does not finish. The option to delete the job cannot be used because it puts the…
imriss
  • 1,815
  • 4
  • 31
  • 46
3
votes
1 answer

Kubernetes Job Pods Become In "Unknown" State

I'm using the K3s distribution of Kubernetes which is deployed on a Spot EC2 Instance in AWS. I have scheduled a certain processing job and sometimes this job is being terminated and becomes in "Unknown" state (the job code is abnormally…
sborpo
  • 928
  • 7
  • 15
3
votes
1 answer

Provide files for kubernetes job

I am trying to create a Kubernetes job, that would run from some machine. I would like that job could somehow copy files from this machine into container running within job itself and do something with them. First of all, is it a good approach?…
Tomek
  • 101
  • 1
  • 9
3
votes
1 answer

How can I check whether K8s volume was mounted correctly?

I'm testing out whether I can mount data from S3 using initContainer. What I intended and expected was same volume being mounted to both initContainer and Container. Data from S3 gets downloaded using InitContainer to mountPath called /s3-data, and…
Piljae Chae
  • 987
  • 10
  • 23
3
votes
2 answers

What happens with memory requests/limits specified in K8s job (container) when job is completed?

I have multi-environment k8s cluster (EKS) and I'm trying to setup accurate values for ResourceQuotas. One interesting thing that I've noticed is that specified request/limit for CPU/memory stay "occupied" in k8s cluster when job is completed…
Bakir Jusufbegovic
  • 2,806
  • 4
  • 32
  • 48
3
votes
1 answer

How to intentionally fail a job in kubernetes?

I have an image of java code that does database validation and the job uses that image. I want the job to intentionally fail when the database validation fails. Is there any way to do the same?
3
votes
2 answers

Kubernetes - run job after pod status is ready

I am basically looking for mechanics similair to init containers with a caveat, that I want it to run after pod is ready (responds to readinessProbe for instance). Are there any hooks that can be applied to readinessProbe, so that it can fire a job…
Łukasz
  • 1,980
  • 6
  • 32
  • 52
3
votes
2 answers

Kubernetes Jobs not Completing

Follwing the documentation and provided example here: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#running-an-example-job I run kubectl apply -f job.yaml kubectl apply -f job.yaml …
Cromat
  • 170
  • 1
  • 16
3
votes
1 answer

How do I prevent independent jobs (which run to completion) from being evicted by the scheduler/autoscaler?

I have a K8s cluster which runs independent jobs (each job has one pod) and I expect them to run to completion. The scheduler, however, sometimes reschedules them on a different node. My jobs need to be single-run, and restarting them on a different…
1
2
3
9 10