mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-07 20:21:20 +00:00
Allow resource.Builder commands to take arguments by type/name
Will allow xarg behavior to fetch resources across multiple types. Changes 'create', 'get', 'update', 'stop', and 'delete' to output <resourceType>/<name>.
This commit is contained in:
@@ -8,13 +8,13 @@ Display one or many resources
|
||||
Display one or many resources.
|
||||
|
||||
Possible resources include pods (po), replication controllers (rc), services
|
||||
(se), minions (mi), or events (ev).
|
||||
(svc), minions (mi), or events (ev).
|
||||
|
||||
By specifying the output as 'template' and providing a Go template as the value
|
||||
of the --template flag, you can filter the attributes of the fetched resource(s).
|
||||
|
||||
```
|
||||
kubectl get [(-o|--output=)json|yaml|template|...] RESOURCE [ID]
|
||||
kubectl get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)
|
||||
```
|
||||
|
||||
### Examples
|
||||
@@ -23,17 +23,20 @@ kubectl get [(-o|--output=)json|yaml|template|...] RESOURCE [ID]
|
||||
// List all pods in ps output format.
|
||||
$ kubectl get pods
|
||||
|
||||
// List a single replication controller with specified ID in ps output format.
|
||||
$ kubectl get replicationController 1234-56-7890-234234-456456
|
||||
// List a single replication controller with specified NAME in ps output format.
|
||||
$ kubectl get replicationController web
|
||||
|
||||
// List a single pod in JSON output format.
|
||||
$ kubectl get -o json pod 1234-56-7890-234234-456456
|
||||
$ kubectl get -o json pod web-pod-13je7
|
||||
|
||||
// Return only the status value of the specified pod.
|
||||
$ kubectl get -o template pod 1234-56-7890-234234-456456 --template={{.currentState.status}}
|
||||
$ kubectl get -o template web-pod-13je7 --template={{.currentState.status}}
|
||||
|
||||
// List all replication controllers and services together in ps output format.
|
||||
$ kubectl get rc,services
|
||||
|
||||
// List one or more resources by their type and names
|
||||
$ kubectl get rc/web service/frontend pods/web-pod-13je7
|
||||
```
|
||||
|
||||
### Options
|
||||
|
Reference in New Issue
Block a user