惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
G
Google Developers Blog
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
J
Java Code Geeks
P
Proofpoint News Feed
V
Visual Studio Blog
爱范儿
爱范儿
The Cloudflare Blog
博客园 - 叶小钗
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
博客园 - 聂微东
H
Help Net Security
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 【当耐特】
量子位
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

hwchiu learning note Blog

Kubernetes 怎麼計算 imageFS | hwchiu learning note Nginx Proxy_Pass 不會重新查詢 DNS | hwchiu learning note Multus 下如何透過 network policy 設定 | hwchiu learning note Linux Bridge MTU | hwchiu learning note Kubevirt 初體驗 | hwchiu learning note [MacOS ]隨手筆記 Sed 與 Rename 的使用 | hwchiu learning note Docusaurus 使用 blog mode 後連結一直反白的問題 | hwchiu learning note gcloud 切換帳號 | hwchiu learning note k8s 內安裝 redis-cluster | hwchiu learning note Helm Chart 中如何根據條件來動態安裝 Template 內的物件 | hwchiu learning note GCS 操作上注意事項 | hwchiu learning note istio 操作記錄 | hwchiu learning note terraform | hwchiu learning note Kubernetes GKE 維運上小筆記 | hwchiu learning note Git 修改 author/committer | hwchiu learning note GCP NAT 相關筆記 | hwchiu learning note gcloud ssh 到 GCP VM | hwchiu learning note CloudSQL 收費注意事項 | hwchiu learning note Loki 安裝上的參數調整以及 Ring 的問題除錯 | hwchiu learning note kustomize + helm | hwchiu learning note 觀測 K8s 內 OOM 事件 | hwchiu learning note GKE 上的 RBAC 筆記 | hwchiu learning note 本地產生 jwt token | hwchiu learning note ArgoCD 安裝筆記 | hwchiu learning note CircleCI Context 的使用 | hwchiu learning note 透過 GCP IAP Gateway 來保護 GKE 內的網站 | hwchiu learning note 閱讀筆記: 「SRE 的工作介绍」 | hwchiu learning note 閱讀筆記: 「DevOps is a failure」 | hwchiu learning note 閱讀筆記: 「面試人生 - 設計一個簡易的分散式 Job Scheduler」 | hwchiu learning note 閱讀筆記: 「Cloudflare 06/21 災後報告」 | hwchiu learning note
閱讀筆記: 「goss, 一個簡易且迅速的 server 驗證工具」 | hw...
HungWei ChiuBlogger · 2022-06-01 · via hwchiu learning note Blog

標題: 「goss, 一個簡易且迅速的 server 驗證工具」 類別: others 連結: https://github.com/aelsabbahy/goss

今天要介紹的是一個驗證工具 goss,該工具的目的非常簡單,讓系統管理員可以透過 YAML 的方式幫機器上的服務撰寫 Unit Testing 什麼情況會需要使用這類型工具?

舉例來說,當你今天部署了一個全新機器(手動/自動後),你安裝了下列軟體

  1. sshd
  2. nginx
  3. docker
  4. ....

同時你也根據需求事先創建了一些使用者,接者你想要驗證這些軟體與相關設定是否設定完成 最直覺的方式就是手動檢查,一個一個服務與設定人工檢查

而 goss 這套軟體的目的就是讓你用 YAML 的方式去撰寫你想要驗證的所有服務,可以用來驗證包含

  1. 使用者 (uid, gid, home, shell)
  2. Package: 系統是否有透過 rpm, de, pacman, apk 等安裝套件
  3. File: 檢查檔案資料夾是否存在
  4. Addr: 用來檢查 $IP:$Port 是否可以被存取
  5. Port: 用來檢查 $Port 是否有開啟
  6. DNS: 用來檢查是否可以解析特定 DNS
  7. Process: 檢查特定 Process 是否有開啟
  8. Mount: 檢查是 Mount Point 以及相關參數
  9. Kernel Param: 檢查 Kernel 參數
  10. ...等

Goss 除了基本用法外,也有人基於其概念往上疊加 dgoss,用來驗證 Docker 的運行狀態,還有類似的 dcgoss,針對 docker-compose 來使用。 當然目前也很多人會透過 Ansible 的方式來自動化部屬,而 Ansible 本身其實也有相關的測試框架可以用來測試部署結果,所以到底要用哪類型的工具 來驗證 Server 等級的狀態就根據團隊需求與現有流程而定,比較沒有一個獨大的工具用法。