Merge pull request #285 from Ma-Dan/master
Add log query and web kubectl docs
|
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
title: "Toolbox"
|
||||
description: "Help you to better understand KubeSphere toolbox usage"
|
||||
layout: "single"
|
||||
|
||||
linkTitle: "Toolbox"
|
||||
|
||||
weight: 1500
|
||||
|
||||
icon: "/images/docs/docs.svg"
|
||||
|
||||
---
|
||||
|
||||
This chapter demonstrates how to use toolbox of KubeSphere to perform log query and Web Kubectl.
|
||||
|
||||
## [Log Query](../toolbox/log-query/)
|
||||
|
||||
Learn how to use log query tool.
|
||||
|
||||
## [Web Kubectl](../toolbox/web-kubectl/)
|
||||
|
||||
Learn how to use web kubectl tool.
|
||||
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
---
|
||||
title: "Log Query"
|
||||
keywords: 'kubesphere, kubernetes, log'
|
||||
description: 'Query kubernetes logs from toolbox'
|
||||
|
||||
linkTitle: "Log Query"
|
||||
weight: 3040
|
||||
---
|
||||
|
||||
The logs of applications and systems can help you understand what is happening inside your cluster and workloads. The logs are particularly useful for debugging problems and monitoring cluster activities. KubeSphere provides a powerful and easy-to-use logging system which offers users the capabilities of log collection, query and management in terms of tenants. Tenant-based logging system is much more useful than Kibana since different tenants can only view her/his own logs, leading much better security. Moreover, KubeSphere logging system filters out lots of redundant information.
|
||||
|
||||
## Objective
|
||||
|
||||
In this tutorial, you will learn how to use log query component to enter log query interface, use search parameters and drill into detail page.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- You need to enable [KubeSphere Logging System](../../pluggable-components/logging/).
|
||||
|
||||
## Enter log query interface
|
||||
|
||||
Log query function is available for all users, log in the console, and mouse over the **Toolbox** in the lower right corner and then select **Log Search**.
|
||||
|
||||

|
||||
|
||||
As shown in the pop-up window, you can see the time histogram of logs amount, cluster selection dropdown list and search parameter input box.
|
||||
|
||||

|
||||
|
||||
{{< notice note >}}
|
||||
- The logging console query logs on each cluster separately, you can switch query cluster using the dropdown list beside the search parameter input box.
|
||||
- The logging console supports the following search parameter fields:
|
||||
- Keyword
|
||||
- Project
|
||||
- Workload
|
||||
- Pod
|
||||
- Container
|
||||
- Time Range
|
||||
- Keywords field supports multiple keyword combination query. For example, you can use "Error", "Fail", "Fatal", "Exception", "Warning" together to query all the exception logs.
|
||||
- Keywords field supports exact query and fuzzy query. Fuzzy query provides case-insensitive fuzzy matching and retrieval of full terms by the first half of a word or phrase because of the ElasticSearch segmentation rules. For example, you can retrieve the logs containing `node_cpu_total` by search the keyword `node_cpu`, but not the keyword `cpu`.
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||

|
||||
|
||||
It also supports customizing the range of time to query, you can input time range directly by selecting `time range` in search parameter input box, or click on the bars in the time histogram, then it will use the time range of that bar as searching time range.
|
||||
|
||||
{{< notice note >}}
|
||||
- KubeSphere stores the logs for last seven days by default.
|
||||
- Each cluster set its own log retain period separately, you can modify log retain period in the ClusterConfig, please refer to [KubeSphere Logging System](../../pluggable-components/logging/) for log retain period setting.
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||
## Use search parameters
|
||||
|
||||
For example, if you want to query the logs on `product` cluster including the keyword `error` in the `kubesphere-system` project within `last 12 hours` shown in the following screenshot.
|
||||
|
||||

|
||||
|
||||
13 rows of logs returned with the corresponding time, project, pod and container information.
|
||||
|
||||
Click any one of the results from the list. Drill into its detail page and inspect the logs from this pod, including the complete context at the right section. It is convenient for developers to debug and analyze.
|
||||
|
||||
{{< notice note >}}
|
||||
- Log query interface support dynamical refresh with 5s, 10s or 15s, and allows to export the logs to local storage for further analysis.
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||

|
||||
|
||||
As you see from the left panel, you can switch to inspect another pod and its container within the same project from the dropdown list. In this case, you can determine if any abnormal pods affect other pods.
|
||||
|
||||

|
||||
|
||||
|
||||
## Drill into detail page
|
||||
|
||||
If the log looks abnormal, you can drill into the the pod detail page or container detail page to deep inspect the container logs, resource monitoring graph and events.
|
||||
|
||||

|
||||
|
||||
Inspect the container detail page as follows. At the same time, it allows you to open the terminal to debug container directly.
|
||||
|
||||

|
||||
|
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
title: "Web Kubectl"
|
||||
keywords: 'kubesphere, kubernetes, kubectl, cli'
|
||||
description: 'Use kubectl from toolbox'
|
||||
|
||||
linkTitle: "Web Kubectl"
|
||||
weight: 3050
|
||||
---
|
||||
|
||||
The Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.
|
||||
|
||||
KubeSphere provides web kubectl on the interface for user convenience. By default, in currently version only the platform administrator (platform-admin) role has the permission to use web kubectl to operate and manage cluster resources.
|
||||
|
||||
## Objective
|
||||
|
||||
In this tutorial, you will learn how to use web kubectl to operate and manage cluster resources.
|
||||
|
||||
## Use web kubectl
|
||||
|
||||
Log on to KubeSphere using the platform administrator role, and mouse over the **Toolbox** in the lower right corner and then select **Kubectl**.
|
||||
|
||||

|
||||
|
||||
As shown in the pop-up window, you can see the kubectl interface, first you should select which cluster to operate from the dropdown list on the upper right corner.
|
||||
|
||||

|
||||
|
||||
You can enter kubectl command in the web kubectl interface to query and operate Kubernetes cluster resources.
|
||||
|
||||
For example, execute the following command to query the status of all PVCs in the cluster.
|
||||
|
||||
|
||||
```
|
||||
kubectl get pvc --all-namespaces
|
||||
```
|
||||
|
||||

|
||||
|
||||
Use the following syntax to run kubectl commands from your terminal window:
|
||||
|
||||
```
|
||||
kubectl [command] [TYPE] [NAME] [flags]
|
||||
```
|
||||
|
||||
{{< notice note >}}
|
||||
- Where `command`, `TYPE`, `NAME`, and `flags` are:
|
||||
- `command`: Specifies the operation that you want to perform on one or more resources, for example `create`, `get`, `describe`, `delete`.
|
||||
- `TYPE`: Specifies the [resource type](https://kubernetes.io/docs/reference/kubectl/overview/#resource-types). Resource types are case-insensitive and you can specify the singular, plural, or abbreviated forms.
|
||||
- `NAME`: Specifies the name of the resource. Names are case-sensitive. If the name is omitted, details for all resources are displayed, for example `kubectl get pods`.
|
||||
- `flags`: Specifies optional flags. For example, you can use the `-s` or `--server` flags to specify the address and port of the Kubernetes API server.
|
||||
- If you need help, just run `kubectl help` from the terminal window, or refer to the [Kubernetes kubectl CLI documentation](https://kubernetes.io/docs/reference/kubectl/overview/).
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||
|
After Width: | Height: | Size: 123 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 115 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 238 KiB |