Skip to content

Commit

Permalink
Merge pull request #21 from Lyt99/feature/v1.0.0
Browse files Browse the repository at this point in the history
Add installation guide
  • Loading branch information
BSWANG authored Apr 9, 2024
2 parents 912e4cd + 8eac7fd commit 40b70d0
Show file tree
Hide file tree
Showing 3 changed files with 228 additions and 138 deletions.
119 changes: 117 additions & 2 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,121 @@ sidebar_position: 3

# Installation

## Install via `skoopbundle.yml`

## Install via Helm

You can install production-ready KubeSkoop instance by Helm.

Execute the following command to add the KubeSkoop repository to Helm and install KubeSkoop:

```shell
# Add kubeskoop repo
helm repo add kubeskoop https://kubeskoop.io/kubeskoop/
# Upgrade helm repo
helm repo update
# Install kubeskoop
helm install -n kubeskoop kubeskoop kubeskoop/kubeskoop
```

The command will install `KubeSkoop` into the `kubeskoop` namespace and turn on the agent, controller and webconsole components of `KubeSkoop` by default.

## Customize Configuration

You can view the values that can be configured by executing the following command.

```shell
helm show values kubeskoop/kubeskoop
```

You can save the values to the `values.yaml` file, make changes to the parameters you need, and then install KubeSkoop with theses values.

```shell
# If you have already installed KubeSkoop, you can upgrade it with `helm upgrade`.
helm install -f values.yaml -n kubeskoop kubeskoop kubeskoop/kubeskoop
```

You can also use the `--set` parameter to customize the configuration.

```shell
helm install --set controller.config.prometheusEndpoint=http://prometheus -n kubeskoop kubeskoop kubeskoop/kubeskoop
```

## Configure Probes

In the `config` section of the values, you can configure the metrics/event probes that need to be turned on.

The default configuration is as follows:

```yaml
config:
metricProbes:
- name: conntrack
- name: qdisc
- name: netdev
- name: io
- name: sock
- name: tcpsummary
- name: tcp
- name: tcpext
- name: udp
- name: kernellatency
- name: packetloss
- name: flow
args:
enablePortInLabel: false
- name: tcpretrans
eventProbes:
- name: biolatency
- name: kernellatency
- name: packetloss
args:
enableStack: false
- name: tcpreset
- name: tcpretrans
eventSinks:
- name: stderr
```
For more information about the probes, please see [the documentation](../reference/monitoring/probes-metrics-events.md).
## Configure Prometheus and Loki Endpoint
Some features (e.g., network graph, anomaly events) of [Web Console](.../guide/web-console.md) relies on Prometheus and Loki.
You need to provide the endpoint for the Prometheus and Loki services during installation.
:::tip
If there is no ready-to-use Prometheus or Loki instances, you can refer to theses documentations:
- Refer to **[Prometheus Installation](https://prometheus.io/docs/prometheus/latest/installation/)** to complete the deployment and installation of Prometheus.
- Refer to **[Install Grafana Loki with Helm](https://grafana.com/docs/loki/latest/setup/install/helm/)** to complete the deployment and installation of Loki.
:::
Configure `prometheusEndpoint` and `lokiEndpoint` in the `controller.config` section.

Assuming that prometheus and loki are installed in the `monitoring` namespace,
and the service names are `prometheus` and `loki`, a sample configuration is as follows:

```yaml
controller:
enabled: true
config:
# configure endpoint address for prometheus.
prometheusEndpoint: 'http://prometheus.monitoring:9090'
# configure endpoint address for loki.
lokiEndpoint: 'http://loki.monitoring:3100'
```

At the same time, the event sinks needs to be configured in `config.eventSink` so that events can be collected via Loki.

```yaml
config:
# ...some probe configurations
eventSinks:
- name: stderr
# configure loki event sink and specify the address as the service address of loki.
- name: loki
args:
addr: 'http://loki.monitoring:3100'
```

Finally, install/update KubeSkoop via `helm install` or `helm upgrade`.
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,114 @@ sidebar_position: 2
## 通过Helm安装

你可以通过Helm来安装生产可用的KubeSkoop实例。

执行以下命令,将KubeSkoop仓库添加到Helm中并安装KubeSkoop:

```shell
# 添加kubeskoop repo
helm repo add kubeskoop https://kubeskoop.io/kubeskoop/
# 更新helm repo
helm repo update
# 安装kubeskoop
helm install -n kubeskoop kubeskoop kubeskoop/kubeskoop
```

该命令将会将`KubeSkoop`安装至`kubeskoop`命名空间,并默认开启`KubeSkoop`的agent、controller和webconsole组件。

## 自定义配置

你可以执行以下命令查看helm chart中可以配置的值。

```shell
helm show values kubeskoop/kubeskoop
```

你可以将值保存至`values.yaml`文件中,对你需要的参数进行修改,然后进行KubeSkoop的安装。

```shell
# 若你已经安装了KubeSkoop,你可以通过`helm upgrade`命令对其进行更新。
helm install -f values.yaml -n kubeskoop kubeskoop kubeskoop/kubeskoop
```

你也可以使用`--set`来进行简单的配置。

```shell
helm install --set controller.config.prometheusEndpoint=http://prometheus -n kubeskoop kubeskoop kubeskoop/kubeskoop
```

## 配置探针

在配置中的`config`一节,可以对所需开启的指标/事件探针进行配置。默认配置如下:

```yaml
config:
metricProbes:
- name: conntrack
- name: qdisc
- name: netdev
- name: io
- name: sock
- name: tcpsummary
- name: tcp
- name: tcpext
- name: udp
- name: kernellatency
- name: packetloss
- name: flow
args:
enablePortInLabel: false
- name: tcpretrans
eventProbes:
- name: biolatency
- name: kernellatency
- name: packetloss
args:
enableStack: false
- name: tcpreset
- name: tcpretrans
eventSinks:
- name: stderr
```
关于探针的更多信息,请见[文档](../reference/monitoring/probes-metrics-events.md)。
## 配置Prometheus和Loki端点地址
[Web控制台](../guide/web-console.md)的部分功能(如网络链路图、异常事件)依赖Prometheus和Loki。你需要在Helm安装时提供Prometheus和Loki服务的端点地址。
:::tip
若没有已经就绪的Prometheus或Loki实例,可以参考以下文档:
- 参考 **[Prometheus的安装](https://prometheus.io/docs/prometheus/latest/installation/)** 完成Prometheus的部署安装。
- 参考 **[使用Helm安装Loki](https://grafana.com/docs/loki/latest/setup/install/helm/)** 完成Loki的部署安装。
:::
`controller.config`一节中配置`prometheusEndpoint`和`lokiEndpoint`。

假设Prometheus和Loki安装在`monitoring`命名空间,并且service名称分别为`prometheus`和`loki`,示例配置如下:

```yaml
controller:
enabled: true
config:
# 配置prometheus的端点地址。
prometheusEndpoint: 'http://prometheus.monitoring:9090'
# 配置loki的端点地址。
lokiEndpoint: 'http://loki.monitoring:3100'
```

同时,需要在`config.eventSink`中配置事件收集器,使事件能够通过Loki收集。

```yaml
config:
# ...其它探针配置
eventSinks:
- name: stderr
# 配置loki事件收集器,并指定地址为loki的service地址。
- name: loki
args:
addr: 'http://loki.monitoring:3100'
```

最后,通过`helm install`或者`helm upgrade`对KubeSkoop进行安装/更新。

This file was deleted.

0 comments on commit 40b70d0

Please sign in to comment.