Add a YAML example to kubectl patch doc
kubectl patch doc says that both YAML and JSON formats are supported, but all examples are in JSON form. We should add atleast one YAML example.
User asking about YAML format: http://stackoverflow.com/questions/36920171/how-can-i-edit-a-deployment-without-modify-the-file-manually#comment61508585_36924484
cc @kubernetes/docs
I tried the following YAML patch:
$ ./cluster/kubectl.sh patch nodes 127.0.0.1 -p '"spec.unschedulable": true'
I got "127.0.0.1" patched response which made me think that the patch succeeded, but looking at the output of kubectl get nodes it didnt.
cc @kubernetes/kubectl
We need an example generated.
Ping. This would still be great to have. Not sure how to accomplish this currently:
~$ kubectl patch statefulset/web -p ' "spec.replicas": 4'
statefulset "web" not patched
This works for me (note the $): kubectl patch deployment in-place-demo --patch $'spec:\n replicas: 5' deployment "in-place-demo" patched kubectl get deployment in-place-demo --output=yaml spec: ... replicas: 5
I'm working on a new Task topic that will cover kubectl edit and kubectl patch: https://github.com/kubernetes/kubernetes.github.io/pull/4519
This also works. Create patch-file.yaml with this content:
spec:
replicas: 6
Note the double quotes. kubectl patch deployment in-place-demo --patch "$(cat patch-file.yaml)"
attn: @nikhiljindal, @ryanmcginnis, @jaredbhatti
Fixed in https://github.com/kubernetes/kubernetes/pull/50532.
So I don't understand why the fix doesn't appear here: https://kubernetes.io/docs/user-guide/kubectl/v1.8/#patch.
cc @pwittrock @chenopis
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Prevent issues from auto-closing with an /lifecycle frozen comment.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale
/remove-lifecycle stale
Steve, did you ever figure out why the fix didn't generate in the API docs?
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
/remove-lifecycle stale
The docs generated actually contains this info. See: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#patch Feel free to reopen if that is not what you want. /close
I am trying to patch node condition type status, is there any example for that ?