Running a cronjob in kubernetes

0 votes
I am trying to schedule Jobs in Kubernetes. The job can be created using the below command.

$ kubectl create -f ./cronjob.yaml

cronjob "hello" created

Is there any REST API using which the Job can be created from a Java client?
Sep 6, 2018 in Kubernetes by lina
• 8,220 points
742 views

1 answer to this question.

0 votes

You will find the CronJobresource in the batch/v1beta1 API group. To create a new CronJob resource, you'll need a POST call to the /apis/batch/v1beta1/namespaces/{namespace}/cronjobs URL.

A respective HTTP request might look something like this:

POST /apis/batch/v1beta1/namespaces/default/cronjobs HTTP/1.1
Content-Type: application/json
Content-Length: ...
Authorization: ...
[other headers]
{
  "metadata": {
    "name": "some-cron"
  },
  "spec": {
    ...
  }
}
answered Sep 6, 2018 by Kalgi
• 52,350 points

Related Questions In Kubernetes

0 votes
1 answer

Environment Variables inside a Cronjob in Kubernetes

Ofcourse you can. Cron job specification is ...READ MORE

answered Sep 18, 2018 in Kubernetes by Kalgi
• 52,350 points
3,911 views
+1 vote
1 answer

How to use a Volume to communicate between two Containers running in the same Kubernetes-Pod?

Create a Pod that runs two Containers Create a ...READ MORE

answered Jul 23, 2019 in Kubernetes by Sirajul
• 59,230 points
2,570 views
0 votes
2 answers

Generally how many nodes will be running in a kubernetes cluster?

Kubernetes latest version 1.17 supports 5000 nodes ...READ MORE

answered Feb 19, 2020 in Kubernetes by Raj
1,712 views
0 votes
1 answer

How to use gravitational teleport in a container/kubernetes environment?

You can use teleport to augment kubernetes ...READ MORE

answered Jun 28, 2018 in Kubernetes by ajs3033
• 7,300 points
2,448 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,401 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,350 points

reshown Apr 12, 2019 by Kalgi 7,018 views
0 votes
1 answer

Running A cronjob in a pod in Kubernetes

Unfortunately, you cannot run the CronJob inside a container ...READ MORE

answered Sep 17, 2018 in Kubernetes by Kalgi
• 52,350 points
2,252 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP