Add YAML example to kubectl patch.#50532
Conversation
|
/assign @lavalamp |
| # Partially update a node using a strategic merge patch. Specify the patch as YAML. | ||
| kubectl patch node k8s-node-1 -p $'spec:\n unschedulable: true' | ||
|
|
||
| # Update a container's image; spec.containers[*].name is required because it's a merge key |
There was a problem hiding this comment.
IMO it is worthwhile to keep this example. Why delete it?
There was a problem hiding this comment.
@mengqiy, Because I can't get it to work. I tried for half a day to do a strategic merge patch on a Pod object. I asked @pwittrock, and he said to patch a Deployment instead. That leads me to believe that you can't change the containers list of a Pod object by doing a strategic merge patch.
There was a problem hiding this comment.
you can change the image name in a pod spec, as this does
There was a problem hiding this comment.
Got it, thanks. I put the example back in.
| # Partially update a node identified by the type and name specified in "node.json" using strategic merge patch | ||
| kubectl patch -f node.json -p '{"spec":{"unschedulable":true}}' | ||
| # Partially update a node using a strategic merge patch. Specify the patch as YAML. | ||
| kubectl patch node k8s-node-1 -p $'spec:\n unschedulable: true' |
There was a problem hiding this comment.
$'spec:\n unschedulable: true'
Yaml patch format doesn't look pretty, but it works.
9942b19 to
16bce23
Compare
16bce23 to
88ab64c
Compare
|
/lgtm |
|
/assign @pwittrock |
|
/retest |
|
@pwittrock, Can you take a look and add your approval if this PR seems OK to you. Thanks. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mengqiy, pwittrock, steveperry-53 Associated issue: 458 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
|
/retest Review the full test history for this PR. |
3 similar comments
|
/retest Review the full test history for this PR. |
|
/retest Review the full test history for this PR. |
|
/retest Review the full test history for this PR. |
|
/test all [submit-queue is verifying that this PR is safe to merge] |
|
@steveperry-53: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here. |
|
/release-note-none This PR doesn't need a release note. A release-note label will lead to noise in CHANGELOG. |
What this PR does / why we need it:
A YAML example has been requested for the kubectl patch reference doc.
fixes #458
Special notes for your reviewer:
Release note: