# 關於 EFK 角色

回顧上一篇，安裝EFK之後有不同角色已經完成部署於環境中。

```bash
kubectl get deploy,sts,ds
NAME                                             DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deployment.extensions/efk-elasticsearch-client   2         2         2            2           1d
deployment.extensions/efk-kibana                 1         1         1            1           1d

NAME                                        DESIRED   CURRENT   AGE
statefulset.apps/efk-elasticsearch-data     3         3         1d
statefulset.apps/efk-elasticsearch-master   3         3         1d

NAME                                  DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.extensions/efk-fluent-bit   3         3         3       3            3           <none>          1d
```

### fluent-bit

此元件作為各節點的log收集與傳送至ES中。因為每個K8s worker node都須部署，故以daemonset方式部署。

### kibana

此元件作為數據圖表化套件，透過deployment方式部署即可。

### elasticsearch

#### elasticsearch-client

此作為ES Client，其用途是ES入口服務，透過deployment方式部署即可。

#### elasticsearch-master

此作為ES叢集的Master角色，關係著整個ES叢集的健康狀態、index分配與調度等等，需要3個master才能進行Master角色選舉。此透過statefulset方式部署。

#### elasticsearch-data

此作為ES儲存資料index的節點，依據資料需求多寡而決定節點數量，可以隨時調整節點數量，此透過statefulset方式部署。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fufu.gitbook.io/kk8s/task-memory/19.efk-role.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
