kube/ctl,ctx,ns

This commit is contained in:
Marc Beninca 2023-07-10 18:39:36 +00:00
parent c420721e09
commit 3b6412da63

View file

@ -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