Editing Kubectl
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | <code>kubectl</code> is a command line interface for running commands against [[Kubernetes]] clusters.<ref>https://kubernetes.io/docs/reference/kubectl/overview/</ref> | |
− | <code> | + | |
+ | To install in MacOS execute: <code>brew install kubernetes-cli</code> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Commands == | == Commands == | ||
− | |||
− | |||
* <code>[[kubectl apply]]</code> | * <code>[[kubectl apply]]</code> | ||
* <code>[[kubectl auth]]</code> | * <code>[[kubectl auth]]</code> | ||
* <code>[[kubectl create]]</code> | * <code>[[kubectl create]]</code> | ||
− | + | * <code>[[kubectl config]]</code> | |
− | * <code>[[kubectl config | + | * <code>[[kubectl debug]]</code> since [[v1.18]] (March 2020). |
− | |||
− | * <code>[[kubectl debug]]</code> | ||
* <code>[[kubectl delete]]</code> | * <code>[[kubectl delete]]</code> | ||
* <code>[[kubectl describe]]</code> | * <code>[[kubectl describe]]</code> | ||
− | * <code>[[kubectl diff]]</code> | + | * <code>[[kubectl diff]]</code> since [[v1.18]] (March 2020). |
* <code>[[kubectl edit]]</code> | * <code>[[kubectl edit]]</code> | ||
− | |||
* <code>[[kubectl expose]]</code> | * <code>[[kubectl expose]]</code> | ||
* <code>[[kubectl exec]]</code> | * <code>[[kubectl exec]]</code> | ||
− | * <code>[[kubectl get]] | + | * <code>[[kubectl get]] [[kubectl get nodes|nodes]]|[[kubectl get pods|pods]]|[[kubectl get replicaset|replicaset]] .../... </code> |
− | |||
* <code>[[kubectl logs]]</code> | * <code>[[kubectl logs]]</code> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
* <code>[[kubectl rolling-update]]</code> | * <code>[[kubectl rolling-update]]</code> | ||
* <code>[[kubectl rollout]]</code> | * <code>[[kubectl rollout]]</code> | ||
− | |||
− | |||
− | |||
== [[Kubectl information commands]] == | == [[Kubectl information commands]] == | ||
Line 87: | Line 68: | ||
* '''[[kubectl get|Get]]''': | * '''[[kubectl get|Get]]''': | ||
− | * '''Replace''': <code> | + | * '''Replace''': <code>kubectl replace --force -f yml_file_describing_pod.yml</code> |
* '''Proxy''': <code>[[kubectl proxy]] --port=8080</code><ref>https://kubernetes.io/docs/tasks/access-kubernetes-api/http-proxy-access-api/</ref> | * '''Proxy''': <code>[[kubectl proxy]] --port=8080</code><ref>https://kubernetes.io/docs/tasks/access-kubernetes-api/http-proxy-access-api/</ref> | ||
Line 95: | Line 76: | ||
*'''Run''' <code>[[kubectl run]] NAME --image=image [--env="key=value"] [--port=port] [--replicas=replicas] [--dry-run=bool] [--overrides=inline-json] [flags]</code>: Run a specified image on the cluster. | *'''Run''' <code>[[kubectl run]] NAME --image=image [--env="key=value"] [--port=port] [--replicas=replicas] [--dry-run=bool] [--overrides=inline-json] [flags]</code>: Run a specified image on the cluster. | ||
− | *'''Scale''': <code> | + | *'''Scale''': <code>kubectl scale deployment YOUR_DEPLOYMENT_NAME</code> |
*'''Stop''' <code>kubectl stop</code> | *'''Stop''' <code>kubectl stop</code> | ||
Line 103: | Line 84: | ||
== Activities == | == Activities == | ||
* [[Create and configure a basic Pod]] (<code>[[kubectl apply]]</code>) | * [[Create and configure a basic Pod]] (<code>[[kubectl apply]]</code>) | ||
− | * Read official | + | * Read official kubectl cheat sheet: https://kubernetes.io/docs/reference/kubectl/cheatsheet/ |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== See also == | == See also == | ||
− | |||
* {{kubectl}} | * {{kubectl}} | ||
+ | * {{k8s}} | ||
+ | |||
+ | [[Category: Software development]] | ||
+ | [[Category:Server administration]] | ||
− | |||
− | |||
{{CC license}} | {{CC license}} | ||
Source: https://en.wikiversity.org/wiki/DevOps/Kubernetes/kubectl | Source: https://en.wikiversity.org/wiki/DevOps/Kubernetes/kubectl |
Advertising: