← 返回上一頁
Kubernetes

Robusta 監控 pod 服務狀態

63a94a198a61e
⚠ 本文最後更新於 2022-12-26(3 年前),部分內容可能已過時。

Robusta 是一個用於K8s 自動化和故障排除的開源框架。它不僅會在出現問題時發出警報,而且還提供有關可能導致這種情況發生的原因的洞察力,甚至建議一鍵修復您遇到的最常見問題(OOMKill、Crashloop、CPUthrottling)。

它使用Prometheus 作為監控部分,並建議在其之上進行修復。它還使您能夠找出可能影響您的集群的任何最近更改。簡而言之,Robusta 正在構建一個包含所有錯誤的數據庫,您可以使用所有可能的解決方案來解決這些錯誤。

安裝

1.建立設定檔

vi Dockerfile

FROM ubuntu:latest
RUN apt-get update && apt-get install -y python3
RUN apt-get -y install python3-pip
RUN pip3 install -U robusta-cli --no-cache
WORKDIR /data
ENTRYPOINT ["robusta"]

docker build -t robusta .

63a9445058050

接下來我們需要生成 Robusta 配置文件。 這是我使用剛剛創建的 docker 容器鏡像

docker run -it -v $PWD:/data  robusta  gen-config

63a946619033a

完成後,一個基本的 generated_values.yaml 文件將存儲在當前目錄中,其中包含用於在集群中安裝 Robusta 

接入slack成功會出現訊息

63a9476178d53

加入helm repo

helm repo add robusta \
https://robusta-charts.storage.googleapis.com && helm repo update

安裝

helm install robusta robusta/robusta -f ./generated_values.yaml --set clusterName='cluster-architecture'

安裝完成訊息

NAME: robusta
LAST DEPLOYED: Mon Dec 26 15:01:22 2022
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
Thank you for installing Robusta 0.10.8

As an open source project, we collect general usage statistics.
This data is extremely limited and contains only general metadata to help us understand usage patterns.
If you are willing to share additional data, please do so! It really help us improve Robusta.

You can set sendAdditionalTelemetry: true as a Helm value to send exception reports and additional data.
This is disabled by default.

To opt-out of telemetry entirely, set a ENABLE_TELEMETRY=false environment variable on the robusta-runner deployment.

Visit the web UI at: https://platform.robusta.dev/

63a94b510580b

部署一個測試pod 驗證告警

kubectl apply -f https://gist.githubusercontent.com/robusta-lab/283609047306dc1f05cf59806ade30b6/raw

63a94916e9009

63a94cd86a017

測試OOMKilld 修改應用的記憶體讓它不能啟動

63a962d9b8247

告警訊息

63a962f92e339

點擊告警上面的連結會到後台可以看到Timeline時間線發生的事件

63a94d4667952

63a94d6d015a6

後台也可以看到所有app的狀態

63a94e7c30cb0

當線上問題解決後也會發回復正常的告警

63a94dc1dcb27

 

分享這篇
X LinkedIn Facebook Hacker News Reddit

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料