- Learn OpenShift
- Denis Zuev Artemii Kropachev Aleksey Usov
- 296字
- 2021-08-13 16:03:51
Getting help
kubectl has hundreds of different subcommands, options, and arguments. Luckily, kubectl has really good help options. The first one is man pages. If you are using macOS or Linux, you can run the man-f kubectl command to check kubectl-related man pages:
$ man -f kubectl
kubectl(1) - kubectl controls the Kubernetes cluster manager
kubectl-alpha(1), kubectl alpha(1) - Commands for features in alpha
kubectl-alpha-diff(1), kubectl alpha diff(1) - Diff different versions of configurations
...
<output omitted>
...
If for some reason you do not have man pages available on your system, you can just run the kubectl command without any options or arguments. It will show you a list of available subcommands:
$ kubectl
kubectl controls the Kubernetes cluster manager.
Find more information at https://github.com/kubernetes/kubernetes.
Basic Commands (Beginner):
create Create a resource from a file or from stdin.
expose Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service
...
<output omitted>
...
Basic Commands (Intermediate):
get Display one or many resources
explain Documentation of resources
...
<output omitted>
...
Use "kubectl <command> --help" for more information about a given command.
Use "kubectl options" for a list of global command-line options (applies to all commands)
The next step is to check the list of available resources by running kubectl <command> or kubectl <command> --help commands, for example, kubectl get:
$ kubectl get
* all
* certificatesigningrequests (aka 'csr')
* clusterrolebindings
...
<output omitted>
...
Use "kubectl explain <resource>" for a detailed description of that resource (e.g. kubectl explain pods).
See 'kubectl get -h' for help and examples.
As you can see, you can also get kubectl get command examples by running kubectl get -h and a detailed resource explanation by running kubectl explain pods. The kubectl command is very easy to navigate and work with.
- Windows Server 2012 Hyper-V:Deploying the Hyper-V Enterprise Server Virtualization Platform
- 構建高可用Linux服務器(第4版)
- WordPress Mobile Web Development:Beginner's Guide
- 蘋果電腦玩全攻略 OS X 10.8 Mountain Lion
- Hands-On DevOps with Vagrant
- Persistence in PHP with the Doctrine ORM
- 嵌入式應用程序設計綜合教程(微課版)
- Linux性能優化
- 構建可擴展分布式系統:方法與實踐
- Linux操作系統應用編程
- 深入Linux內核架構與底層原理(第2版)
- 奔跑吧 Linux內核(入門篇)
- Windows Phone 8 Application Development Essentials
- 嵌入式實時操作系統μC/OS原理與實踐
- Linux基礎使用與案例