- Getting Started with Kubernetes
- Jonathan Baier Jesse White
- 299字
- 2021-06-10 19:46:59
Command line
The kubectl script has commands for exploring our cluster and the workloads running on it. You can find it in the /kubernetes/client/bin folder. We will be using this command throughout the book, so let's take a second to set up our environment. We can do so by putting the binaries folder on our PATH, in the following manner:
$ export PATH=$PATH:/<Path where you downloaded K8s>/kubernetes/client/bin
$ chmod +x /<Path where you downloaded K8s>/kubernetes/client/bin
Now that we have kubectl on our path, we can start working with it. It has quite a few commands. Since we have not spun up any applications yet, most of these commands will not be very interesting. However, we can explore two commands right away.
First, we have already seen the cluster-info command during initialization, but we can run it again at any time with the following command:
$ kubectl cluster-info
Another useful command is get. It can be used to see currently running services, pods, replication controllers, and a lot more. Here are the three examples that are useful right out of the gate:
- Lists the nodes in our cluster:
$ kubectl get nodes
- Lists cluster events:
$ kubectl get events
- Finally, we can see any services that are running in the cluster, as follows:
$ kubectl get services
To start with, we will only see one service, named kubernetes. This service is the core API server for the cluster.
For any of the preceding commands, you can always add a -h flag on the end to understand the intended usage.
- Instant Raspberry Pi Gaming
- Visualforce Development Cookbook(Second Edition)
- Verilog HDL數字系統設計入門與應用實例
- Hands-On Cloud Solutions with Azure
- 智能工業報警系統
- 小型電動機實用設計手冊
- 讓每張照片都成為佳作的Photoshop后期技法
- 21天學通Visual Basic
- AWS Administration Cookbook
- 面向對象程序設計綜合實踐
- 氣動系統裝調與PLC控制
- SQL Server數據庫應用基礎(第2版)
- WOW!Photoshop CS6完全自學寶典
- 人工智能:智能人機交互
- Redash v5 Quick Start Guide