偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

一款超好用的 Kubernetes 配置錯(cuò)誤檢測(cè)工具 Datree

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

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

Datree 為 Kubernetes 提供了一種策略執(zhí)行解決方案,對(duì)每一行代碼變更都會(huì)進(jìn)行自動(dòng)檢查,以防止違反規(guī)則和錯(cuò)誤配置。當(dāng)發(fā)現(xiàn)違反規(guī)則時(shí),Datree 會(huì)產(chǎn)生一個(gè)警報(bào),指導(dǎo)開發(fā)人員在 CI 過程中去修復(fù)問題,同時(shí)也會(huì)對(duì)這些規(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 進(jìn)行掃描。

datree test [k8s-manifest-file]

這樣就進(jìn)行了一次檢查了??。

插件

Datree 還提供了很多插件來增強(qiáng)體驗(yàn)。

Helm插件

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

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

VSCode插件

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

Kustomize支持

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

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

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

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

此外還可以配置 Git Hooks。

策略

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

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

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

CI/CD集成

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

比如在 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

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

2015-11-16 14:27:03

2011-01-11 13:38:21

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

2010-12-28 15:46:08

2015-09-28 18:05:52

安全審計(jì)入侵檢測(cè)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檢測(cè)工具

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ù)

2020-08-12 09:35:23

Docker工具開源

2021-06-27 07:26:45

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

2011-01-19 13:19:39

Thunderbird插件

2019-08-02 14:45:22

阿里Java命令

2021-07-07 06:52:17

云圖word-cloud工具

2019-07-22 09:24:54

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

2019-11-11 08:00:00

Doppler遠(yuǎn)程監(jiān)測(cè)工具Linux
點(diǎn)贊
收藏

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