自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

一款超好用的 Kubernetes 配置錯誤檢測工具 Datree

系統(tǒng) Linux
Datree 為 Kubernetes 提供了一種策略執(zhí)行解決方案,對每一行代碼變更都會進行自動檢查,以防止違反規(guī)則和錯誤配置。

Datree 是一個可以檢測 Kubernetes 資源清單錯誤配置的 CLI 工具,可確保 Kubernetes 資源清單和 Helm Charts 遵循最佳實踐,防止開發(fā)人員在 Kubernetes 配置中出現(xiàn)錯誤,導致集群在生產(chǎn)中出現(xiàn)錯誤。它比人工處理要有效得多,比如給開發(fā)者發(fā)郵件,懇求他們設置各種限制,而這很可能會因為開發(fā)者已經(jīng)不堪重負而被選擇性忘記~

Datree 為 Kubernetes 提供了一種策略執(zhí)行解決方案,對每一行代碼變更都會進行自動檢查,以防止違反規(guī)則和錯誤配置。當發(fā)現(xiàn)違反規(guī)則時,Datree 會產(chǎn)生一個警報,指導開發(fā)人員在 CI 過程中去修復問題,同時也會對這些規(guī)則背后的原因做出解釋。

安裝

只需要兩步即可開始使用 Datree。

  1. 安裝最新版本的 Datre。
  • Linux & MacOS: curl https://get.datree.io | /bin/bash
  • Windows: iwr -useb https://get.datree.io/windows_install.ps1 | iex
  • 其他安裝方式(Homebrew、Docker等等)可以查看文檔 https://hub.datree.io/
  1. 將 Kubernetes 資源清單文件傳遞給 Datree 進行掃描。

datree test [k8s-manifest-file]

這樣就進行了一次檢查了??。

插件

Datree 還提供了很多插件來增強體驗。

Helm插件

Datree 的 Helm 插件可以通過 Helm CLI 訪問,為 Helm 用戶提供無縫體驗,執(zhí)行下面的命令即可啟用 Helm 插件:

helm plugin install https://github.com/datreeio/helm-datree

VSCode插件

允許你在 Kubernetes 配置上運行 Datree 測試,插件地址:https://marketplace.visualstudio.com/items?itemName=suyashsonawane.vscode-datree

Kustomize支持

Datree 為 Kustomize 提供了開箱即用的支持,允許你輕松掃描 Kustomization 文件以及它將為錯誤配置生成的資源。

在測試 kustomization 目錄時,Datree 將構(gòu)建 kustomization.yaml 中定義的資源的臨時副本,并對它們運行策略檢查。

只需將 kustomize 參數(shù)添加到 CLI 命令中即可,如下所示:

datree kustomize test [path] [cliArgs] -- [kustomizeArgs]
  • path:表示所需 kustomize 目錄的路徑(包含 kustomization.yaml 文件)
  • cliArgs(可選):Datree CLI 參數(shù)
  • kustomizeArgs(可選):kustomize build命令的參數(shù),要查看支持的參數(shù)列表,請運行 kustomize build -h 或 kubectl kustomize -h

此外還可以配置 Git Hooks。

策略

每個策略檢查都將驗證你的 Kubernetes Schema,此外,還有很多 Datree 內(nèi)置的一些策略規(guī)則。這些規(guī)則涵蓋了各種 Kubernetes 資源和用例:

  • Workload
  • CronJob
  • Containers
  • Networking
  • Security
  • Deprecation
  • Others

除了內(nèi)置的規(guī)則之外,你還可以編寫任何希望的自定義規(guī)則,然后針對你的 Kubernetes 配置來檢查是否違反規(guī)則,自定義規(guī)則引擎是基于 JSON Schema 的。更多的策略使用可以參考官方文檔:https://hub.datree.io。

CI/CD集成

像任何 linter 或靜態(tài)代碼分析工具一樣,Datree 的命令行工具可以與所有 CI/CD 平臺集成,自動掃描每行代碼變化并作為工作流程的一部分提供反饋。

比如在 Gitlab CI 中使用 Datree:

image: node:14
stages:
- test
test:
stage: test
script:
- curl https://get.datree.io | /bin/bash
- datree test ~/.datree/k8s-demo.yaml

在 Jenkins Pipeline 中使用 Datree:

pipeline{
agent any
stages{
stage('indentifying misconfigs using datree'){
steps{
script{
withEnv(['DATREE_TOKEN=<your-account-token>']) {
sh 'datree test *.yaml --only-k8s-files'
}
}
}
}
}
}

   倉庫地址:https://github.com/datreeio/datree

責任編輯:龐桂玉 來源: 奇妙的Linux世界
相關(guān)推薦

2015-11-16 14:27:03

2011-01-11 13:38:21

CPU-Z系統(tǒng)檢測

2010-12-28 15:46:08

2015-09-28 18:05:52

安全審計入侵檢測Tiger–UNIX

2020-11-12 10:00:56

Kubernetes工具Linux

2021-01-27 13:16:39

ScreenLinux命令

2021-02-16 10:58:50

ScreenLinux命令

2023-05-12 13:20:07

ChatGPTAIGC檢測工具

2020-12-16 15:56:05

Kubernetes日志工具

2020-11-09 16:20:59

Kubernetes工具Linux

2024-02-23 08:13:25

Excalidraw白板工具開源

2015-10-27 13:45:58

CloneAppWindows工具

2022-08-15 08:02:09

Go程序函數(shù)

2021-06-27 07:26:45

Windows 11操作系統(tǒng)微軟

2019-08-02 14:45:22

阿里Java命令

2021-07-07 06:52:17

云圖word-cloud工具

2011-01-19 13:19:39

Thunderbird插件

2020-08-12 09:35:23

Docker工具開源

2019-07-22 09:24:54

LinuxMySQL數(shù)據(jù)庫

2020-11-17 09:27:26

KubernetesYAMLKubeLinter
點贊
收藏

51CTO技術(shù)棧公眾號