kube/ctl,ctx,ns
This commit is contained in:
parent
c420721e09
commit
3b6412da63
1 changed files with 44 additions and 0 deletions
|
@ -618,3 +618,47 @@ Commands
|
|||
matchExpressions:
|
||||
- {key: version, operator: In, values: ["1.0","1.1","1.2"]}
|
||||
|
||||
kubectl
|
||||
=======
|
||||
|
||||
* kubectl version = api-server version ± 0.1
|
||||
|
||||
.. code:: shell
|
||||
|
||||
kubectl \
|
||||
get namespace \
|
||||
-o 'custom-columns="NAME":".metadata.name"' \
|
||||
--no-headers
|
||||
|
||||
.. code:: shell
|
||||
|
||||
kubectl \
|
||||
-n my-namespace \
|
||||
get pod \
|
||||
--sort-by '.status.phase'
|
||||
|
||||
.. code:: shell
|
||||
|
||||
kubectl \
|
||||
-n my-namespace \
|
||||
get pod \
|
||||
--watch
|
||||
|
||||
.. code:: shell
|
||||
|
||||
kubectl \
|
||||
-n my-namespace \
|
||||
exec my-pod \
|
||||
-it -- \
|
||||
ls
|
||||
|
||||
.. code:: shell
|
||||
|
||||
kubectl config use-context my-cluster
|
||||
kubectx my-cluster
|
||||
|
||||
.. code:: shell
|
||||
|
||||
kubectl config set-context --current --namespace my-namespace
|
||||
kubens my-namespace
|
||||
|
||||
|
|
Loading…
Reference in a new issue