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,520 points
1,657 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,350 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,350 points
1,015 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,520 points
1,427 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,060 points
947 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,350 points
921 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,477 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 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,520 points
1,889 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,060 points
2,756 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