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:
@@ -17,7 +17,7 @@ Display one or many resources.
|
||||
|
||||
.PP
|
||||
Possible resources include pods (po), replication controllers (rc), services
|
||||
(se), minions (mi), or events (ev).
|
||||
(svc), minions (mi), or events (ev).
|
||||
|
||||
.PP
|
||||
By specifying the output as 'template' and providing a Go template as the value
|
||||
@@ -169,18 +169,21 @@ of the \-\-template flag, you can filter the attributes of the fetched resource(
|
||||
// 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
|
||||
|
||||
.fi
|
||||
.RE
|
||||
|
||||
|
Reference in New Issue
Block a user