概述
架構圖
以下是 Rancher Turtles 的關鍵元件以及它們與 Rancher 和 Rancher Cluster Agent 之間關係的視覺化表示。了解這些元件對於深入了解 Rancher 如何利用 CAPI operator 進行叢集管理至關重要。

安全性
根據 Supply-chain Levels for Software Artifacts (SLSA) 的定義,SLSA 是一組由業界共識建立的供應鏈安全遞增式採用指南。SLSA 制定的規範對軟體生產者和消費者都很有用:生產者可以遵循 SLSA 的指南使其軟體供應鏈更加安全,消費者可以使用 SLSA 來決定是否信任軟體套件。
Rancher Turtles 符合 SLSA Level 3 要求,作為適當的強化建置平台,具有一致的建置流程和來源分發。有關更多資訊,請造訪 Rancher Turtles Security 文件。
先決條件
在 Rancher 環境中安裝 Rancher Turtles 之前,您必須停用 Rancher 的 embedded-cluster-api 功能。這還包括清理 Rancher 特定的 webhooks,否則會與 CAPI 的 webhooks 衝突。
為了簡化為安裝 Rancher Turtles 而設定 Rancher,官方 Rancher Turtles Helm chart 包含一個 pre-install hook,它會移除以下內容:
- 在 Rancher 中停用
embedded-cluster-api功能。 - 刪除
mutating-webhook-configuration和validating-webhook-configurationwebhooks,因為它們不再需要。
這些 webhooks 也可以透過 Rancher UI 移除:
- 在左上角,點擊 ☰ > Cluster Management。
- 選擇您的本機叢集。
- 在左側導航選單中,選擇 More Resources > Admission。
- 從下拉選單中,選擇
MutatingWebhookConfiguration和ValidatingWebhookConfiguration的資源頁面。 - 在相應的資源頁面上,點擊附加到
mutating-webhook-configuration和validating-webhook-configurationwebhooks 的 ⋮,然後選擇 Delete 選項。
也可以透過在 Resource Search 欄位中輸入 webhooks 的名稱來存取 webhooks。
以下 kubectl 命令可以手動移除必要的 webhooks:
kubectl delete mutatingwebhookconfiguration.admissionregistration.k8s.io mutating-webhook-configuration
kubectl delete validatingwebhookconfigurations.admissionregistration.k8s.io validating-webhook-configuration
使用以下範例從控制台停用 embedded-cluster-api 功能:
- 建立一個
feature.yaml檔案,將embedded-cluster-api設定為 false:
apiVersion: management.cattle.io/v3
kind: Feature
metadata:
name: embedded-cluster-api
spec:
value: false
- 使用
kubectl將feature.yaml檔案應用到叢集:
kubectl apply -f feature.yaml
安裝 Rancher Turtles Operator
您可以透過 Rancher UI 或使用 Helm 安裝 Rancher Turtles operator。建議大多數環境使用第一種方法。
如果您的叢集中已經安裝了 Cluster API (CAPI) Operator,您必須使用手動 Helm 安裝方法。
透過 Rancher UI 安裝
透過 Rancher UI 新增 Turtles 儲存庫,Rancher 可以處理 CAPI Extension 的安裝和配置。
- 點擊 ☰。在左側導航選單的 Explore Cluster 下,選擇 local。
- 在 Cluster Dashboard 的左側導航選單中,選擇 Apps > Repositories。
- 點擊 Create 以新增新的儲存庫。
- 輸入以下內容:
- Name: turtles
- Index URL: https://rancher.github.io/turtles
- 等待新儲存庫的狀態為
Active。 - 在左側導航選單中,選擇 Apps > Charts。
- 在搜尋篩選器中輸入 "turtles" 以找到 Turtles chart。
- 點擊 Rancher Turtles - the Cluster API Extension