Questions tagged [kubernetes-cronjob]

301 questions
0
votes
0 answers

How to schedule a Kubernetes object creation at a later time?

I have two Custom Resource Definitions (CRDs), backup and scheduled backup. And I would like to run a backup operation at a specific time, following is the architecture that I came up with which gives me a guarantee that the backup operation will be…
Vishrant
  • 15,456
  • 11
  • 71
  • 120
0
votes
2 answers

Split string and extract variables with shell script

Question Given this single-line string: PG_USER=postgres PG_PORT=1234 PG_PASS=icontain=and*symbols What would be the right way to assign each value to its designated variable so that I can use it afterward? Context I'm parsing the context of a k8s…
payne
  • 4,691
  • 8
  • 37
  • 85
0
votes
1 answer

Is there a way to inject job id as an env variable into a container in kubernetes?

The yaml below injects the pod's name into the container as RUN_ID. If this cron job spins up 10 pods (parallelism = 10), each of the 10 pods will have a different run id. But I want all the 10 pods to have the same run id. DownwardApi doesn't seem…
leaner12
  • 111
  • 1
  • 6
0
votes
1 answer

Executing a Script using a Cronjob Kubernetes Cluster

I have a 3 node K8 v1.21 cluster in AWS and looking for SOLID config to run a script using a cronjob. I have seen many documents on here and Google using cronjob and hostPath to Persistent Volumes/Claims to using ConfigMaps, the list goes one. I…
0
votes
1 answer

Prevent cluster autoscaling from killing pod

I have a AWS EKS K8s setup with autoscaling group that uses spot instances. Once a day there is a scheduled K8s cronjob which scales down a bunch of deployments, runs a script in a pod for 15min , then scales the deployments back up. Issue is after…
0
votes
0 answers

How do I run a full Kubernetes deployment as a CronJob without recreating the entire deployment file?

I am running an API Platform backend which deploys using Helm. The chart for the PHP server deployment is here: https://github.com/api-platform/api-platform/blob/main/helm/api-platform/templates/deployment.yaml I am hoping to run a Kubernetes…
Brettins
  • 862
  • 11
  • 24
0
votes
1 answer

Kubernetes Cronjob Pod Scheduling Issue

I need to understand the behavior of kubernetes cronjob. New cronjob pod is started even when previous jobs is not completed. There is only one pod running against this job and previous pod has vanished. Why new job is started when first one is not…
Ali Ahmad
  • 1,055
  • 5
  • 27
  • 47
0
votes
0 answers

Kubernetes: How can i run kubectl command inside cronjob pod in k8s?

I have written shell script for k8s cronjob which uses kubectl command to get namespaces with needed parameters (like age, name etc). But i have an issue like this: Error from server (Forbidden): namespaces is forbidden: User…
0
votes
0 answers

Run cron job with curl to execute django command management

I have a command management that I should run daily at midnight, I usually execute it from my pc, I want to create a cronjob that can do this automatically here the command that I execute from my local environment: env=application; kubectl exec -ti…
ladhari
  • 505
  • 4
  • 15
0
votes
2 answers

Export logs of Kubernetes cronjob to a path after each run

I currently have a Cronjob that has a job that schedule at some period of time and run in a pattern. I want to export the logs of each pod runs to a file in the path as temp/logs/FILENAME with the FILENAME to be the timestamp of the run being…
ddttdd
  • 111
  • 1
  • 6
0
votes
1 answer

Can we spin off a kubernetes cronjob automatically and dynamically? How can we do it in AWS EKS, Azure AKS based on queues or notifications?

For my microservice based application, I am designing a component which is as follows: Task that we want to execute is of periodic nature. For it, i planned to make use of the Kubernetes cron-jobs. It executes the job every 1 hour. This works…
0
votes
1 answer

How to create an ML pipeline for model retraining and inference [Kubernetes]

I am working on a task where I need to design an ML pipeline for model retraining and inference on Kubernetes I read some articles and watched some tutorials, with the help of which I have created 2 apps as described below For Model retraining, I…
0
votes
1 answer

cURL doesn't save the cookie inside a k8s cronjob

I want to create a cronjob that interacts with my API. First, I need to send a request to authentificate, then send a GET request Here is the yaml of my cronjob: apiVersion: batch/v1beta1 kind: CronJob metadata: name: verification-pointage …
Couldosh
  • 371
  • 3
  • 17
0
votes
2 answers

How to start another application(pod) from a CRON JOB

I have a CRON JOB in Azure k8s which trigger once a day, based on the condition written inside of this CRON JOB (image), I need to start another application/s(Pods) which will do some process and dies
0
votes
0 answers

Error Cleaning Up Jobs in Kubernetes 1.21

This started happening when we upgraded to Kubernetes 1.21. The following message occurs: Jul 08 07:00:01 1 cronjob_controllerv2.go:193] "error cleaning up jobs" cronjob="default/vet-messenger-batch-prod-hourly" resourceVersion="160274892"…
Craig Riecke
  • 121
  • 1
  • 6