kubectl-cheatsheet - patch, added example for add (#4546)
* kubectl-cheatsheet - patch, added example for add * Changed patch example to use k8s native resource * Removed line from kubectl-cheatsheet
This commit is contained in:
committed by
Steve Perry
parent
ce0e1fa9fd
commit
69c6cb07de
@@ -159,7 +159,6 @@ $ kubectl autoscale deployment foo --min=2 --max=10 # Auto scale
|
||||
```
|
||||
|
||||
## Patching Resources
|
||||
Patch a resource(s) with a strategic merge patch.
|
||||
|
||||
```console
|
||||
$ kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}' # Partially update a node
|
||||
@@ -172,6 +171,9 @@ $ kubectl patch pod valid-pod --type='json' -p='[{"op": "replace", "path": "/spe
|
||||
|
||||
# Disable a deployment livenessProbe using a json patch with positional arrays
|
||||
$ kubectl patch deployment valid-deployment --type json -p='[{"op": "remove", "path": "/spec/template/spec/containers/0/livenessProbe"}]'
|
||||
|
||||
# Add a new element to a positional array
|
||||
$ kubectl patch sa default --type='json' -p='[{"op": "add", "path": "/secrets/1", "value": {"name": "whatever" } }]'
|
||||
```
|
||||
|
||||
## Editing Resources
|
||||
|
||||
Reference in New Issue
Block a user