Kubernetes - Job scheduling API

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 17, 2018 in Kubernetes by Hannah
• 18,570 points
1,470 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 17, 2018 by Kalgi
• 52,360 points

Related Questions In Kubernetes

0 votes
1 answer

Not able to access kubernetes api from a pod in azure

Follow these steps Add --bind-address=0.0.0.0 option to the line https://github.com/kubernetes/kubernetes/blob/v1.2.0/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml#L218  Created ...READ MORE

answered Aug 30, 2018 in Kubernetes by Kalgi
• 52,360 points
812 views
0 votes
3 answers

Request Kubernetes API server

Create a api wrapper. This way you ...READ MORE

answered Aug 31, 2018 in Kubernetes by Hannah
• 18,570 points
1,170 views
0 votes
2 answers

Monitoring kubernetes job

you can do watch 'kubectl get pods | ...READ MORE

answered Sep 3, 2018 in Kubernetes by Nilesh
• 7,050 points
607 views
0 votes
1 answer

Kubernetes API authentication

Best way to retrieve the token is: kubectl ...READ MORE

answered Sep 3, 2018 in Kubernetes by Kalgi
• 52,360 points
683 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
14,575 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,360 points

reshown Apr 12, 2019 by Kalgi 6,053 views
0 votes
2 answers

Access Kubernetes API using minKube

Try these commands: kubectl proxy --port=8080 You can then ...READ MORE

answered Aug 28, 2018 in Kubernetes by Hannah
• 18,570 points
1,619 views
0 votes
2 answers

Access Kubernetes api from within a pod container

wget version: KUBE_TOKEN=$(</var/run/secrets/kubernetes.io/serviceaccount/token) wget -vO- ...READ MORE

answered Aug 29, 2018 in Kubernetes by Nilesh
• 7,050 points
2,397 views
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