- 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.
- Modern Web Testing with TestCafe
- Persistence in PHP with the Doctrine ORM
- Kali Linux滲透測(cè)試全流程詳解
- Implementing Azure DevOps Solutions
- Windows Server 2012網(wǎng)絡(luò)操作系統(tǒng)企業(yè)應(yīng)用案例詳解
- Kubernetes從入門到實(shí)踐
- Kali Linux 2018:Windows Penetration Testing
- Linux內(nèi)核設(shè)計(jì)的藝術(shù):圖解Linux操作系統(tǒng)架構(gòu)設(shè)計(jì)與實(shí)現(xiàn)原理
- iOS 8開發(fā)指南
- 從實(shí)踐中學(xué)習(xí)Windows滲透測(cè)試
- 統(tǒng)信UOS應(yīng)用開發(fā)進(jìn)階教程
- Agile IT Security Implementation Methodology
- Linux操作系統(tǒng)案例教程(第2版)
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)(Windows 7+Office 2010)
- Implementing Cloud Design Patterns for AWS(Second Edition)