add kubectl diff in common operations (#18665)

This commit is contained in:
zhouya0
2020-01-16 22:54:23 +08:00
committed by Kubernetes Prow Robot
parent e0cd2accbe
commit 1ae1305680
+11 -1
View File
@@ -79,7 +79,7 @@ Operation | Syntax | Description
`create` | `kubectl create -f FILENAME [flags]` | Create one or more resources from a file or stdin.
`delete` | `kubectl delete (-f FILENAME \| TYPE [NAME \| /NAME \| -l label \| --all]) [flags]` | Delete resources either from a file, stdin, or specifying label selectors, names, resource selectors, or resources.
`describe` | `kubectl describe (-f FILENAME \| TYPE [NAME_PREFIX \| /NAME \| -l label]) [flags]` | Display the detailed state of one or more resources.
`diff` | `kubectl diff -f FILENAME [flags]`| Diff file or stdin against live configuration (**BETA**)
`diff` | `kubectl diff -f FILENAME [flags]`| Diff file or stdin against live configuration
`edit` | `kubectl edit (-f FILENAME \| TYPE NAME \| TYPE/NAME) [flags]` | Edit and update the definition of one or more resources on the server by using the default editor.
`exec` | `kubectl exec POD [-c CONTAINER] [-i] [-t] [flags] [-- COMMAND [args...]]` | Execute a command against a container in a pod.
`explain` | `kubectl explain [--recursive=false] [flags]` | Get documentation of various resources. For instance pods, nodes, services, etc.
@@ -373,6 +373,16 @@ kubectl logs <pod-name>
kubectl logs -f <pod-name>
```
`kubectl diff` - View a diff of the proposed updates to a cluster.
```shell
# Diff resources included in "pod.json".
kubectl diff -f pod.json
# Diff file read from stdin.
cat service.yaml | kubectl diff -f -
```
## Examples: Creating and using plugins
Use the following set of examples to help you familiarize yourself with writing and using `kubectl` plugins: