Created a job in kubernetes using post method using postman, now trying to patch the same job using patch method using postman and i am getting 400 bad request.
Headers for post: Content-type application/yaml
post method body:
---
apiVersion: batch/v1
kind: Job
metadata:
name: pi
labels:
app: dev
spec:
template:
spec:
containers:
- name: pi
image: perl
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
restartPolicy: Never
backoffLimit: 4
Headers for patch : Content-type application/strategic-merge-patch+json
patch request body:
{
"apiVersion": "batch/v1",
"kind": "Job",
"metadata": {
"name": "pi"
},
"spec": {
"template": {
"spec": {
"containers": [
{
"name": "pi",
"image": "perl",
"command": [
"perl",
"-Mbignum=bpi",
"-wle",
"print bpi(2000)"
]
}
],
"restartPolicy": "Never"
}
},
"backoffLimit": 5
}
}
Changed body please check the link. body of the patch request
Modification i did was changed backofflimit to 5. I was able to post and patch other resources like services and deployments but i am stuck at patching a job, I followed exactly same steps for others as well.
error i am getting error