技能 linkerd-patterns
🔗

linkerd-patterns

低風險 ⚙️ 外部命令🌐 網路存取

部署 Linkerd Service Mesh

也可從以下取得: wshobson

此技能提供在 Kubernetes 上部署和配置 Linkerd service mesh 的生產環境就緒模式,啟用自動 mTLS、流量管理和零信任安全策略。

支援: Claude Codex Code(CC)
⚠️ 67
1

下載技能 ZIP

2

在 Claude 中上傳

前往 設定 → 功能 → 技能 → 上傳技能

3

開啟並開始使用

測試它

正在使用「linkerd-patterns」。 在我的 Kubernetes cluster 上安裝 Linkerd

預期結果:

以下是安裝 Linkerd 的方法:

1. 安裝 Linkerd CLI:
curl --proto '=https' --tlsv1.2 -sSfL https://run.linkerd.io/install | sh

2. 驗證 cluster:
linkerd check --pre

3. 安裝 CRDs:
linkerd install --crds | kubectl apply -f -

4. 安裝 control plane:
linkerd install | kubectl apply -f -

5. 驗證安裝:
linkerd check

正在使用「linkerd-patterns」。 建立 canary deployment 設定

預期結果:

以下是 canary deployment 的 TrafficSplit 配置:

```yaml
apiVersion: split.smi-spec.io/v1alpha1
kind: TrafficSplit
metadata:
name: my-service-canary
namespace: my-namespace
spec:
service: my-service
backends:
- service: my-service-stable
weight: 900m
- service: my-service-canary
weight: 100m
```

這將 90% 路由到 stable,10% 路由到 canary。

正在使用「linkerd-patterns」。 如何啟用自動重試?

預期結果:

建立帶有 retry 配置的 ServiceProfile:

```yaml
apiVersion: linkerd.io/v1alpha2
kind: ServiceProfile
metadata:
name: my-service.my-namespace.svc.cluster.local
spec:
routes:
- name: GET /api/users
condition:
method: GET
pathRegex: /api/users
isRetryable: true
retryBudget:
retryRatio: 0.2
minRetriesPerSecond: 10
ttl: 10s
```

retryBudget 允許來自重試的多達 20% 額外流量。

安全審計

低風險
v1 • 2/25/2026

This skill provides Linkerd service mesh documentation and YAML templates. The static findings are false positives: shell commands are example documentation blocks, URLs point to official Linkerd resources, and the pipe-to-shell pattern is the standard installation method from Linkerd's official docs. No malicious intent detected.

1
已掃描檔案
324
分析行數
5
發現項
1
審計總數
中風險問題 (2)
Shell Commands in Documentation
The skill contains shell command examples (e.g., 'linkerd install', 'kubectl apply'). These are documentation/templates, not executable code. No user input is processed or executed.
External URLs in Documentation
The skill references external URLs including official Linkerd installation script and documentation links. These are legitimate resources from the official Linkerd project.
低風險問題 (1)
Example IP CIDR Range
A sample CIDR range (10.0.0.0/8) is used in a ServerAuthorization policy example. This is a standard private network range used in documentation.
審計者: claude

品質評分

38
架構
100
可維護性
87
內容
20
社群
78
安全
100
規範符合性

你能建構什麼

設定 Service Mesh 的 DevOps 工程師

DevOps 工程師需要使用自動 mTLS 保護微服務通訊,並實作 canary deployment 的流量分割。

實作 Zero-Trust 的安全工程師

安全工程師希望使用 Linkerd 的 ServerAuthorization 限制服務之間的流量,以執行零信任網路策略。

管理 Multi-Cluster 的平台團隊

平台團隊需要將 Linkerd 扩展到多個 Kubernetes clusters 以實現高可用性和災難恢復。

試試這些提示

基本 Linkerd 安裝
在我的 Kubernetes cluster 上安裝 Linkerd 並驗證安裝是否正常運作。
啟用自動 mTLS
向我展示如何為 'my-app' namespace 中的所有 pods 啟用自動 mTLS,並解釋 Linkerd 如何處理 certificate rotation。
配置 Canary Deployment
建立 TrafficSplit 配置,將 10% 的流量路由到 'my-service-canary',90% 路由到 'my-service-stable' 以進行 canary deployment。
設定 Service Authorization
建立 ServerAuthorization 和 Server resources 以僅允許 'frontend' service account 透過 mesh TLS 在 port 8080 上存取 'my-service'。

最佳實務

  • 在任何配置變更後始終執行 'linkerd check' 以驗證正確性
  • 為所有服務啟用 ServiceProfiles 以獲取 per-route metrics 並啟用重試
  • 從寬鬆的策略開始並逐步加強;首先使用 Linkerd 的可視化功能了解流量模式

避免

  • 跳過 'linkerd check --pre' 的安裝前檢查
  • 在不了解對現有流量影響的情況下套用配置
  • 設定過於寬泛的 ServerAuthorization policies 而破壞 zero-trust 目標

常見問題

什麼是 Linkerd?
Linkerd 是一個用於 Kubernetes 的 service mesh,為微服務通訊提供自動 mTLS、流量管理、可觀察性和安全策略。
Linkerd 需要程式碼變更嗎?
不需要,Linkerd 透過將 proxy sidecar 注入 pods 來運作。大多數功能無需對應用程式進行任何程式碼變更即可運作。
自動 mTLS 如何運作?
Linkerd 會自動為所有 pod-to-pod 通訊簽發和輪換 TLS certificates。服務使用 mutual TLS 相互驗證,無需任何配置。
我可以將 Linkerd 與 ingress controllers 一起使用嗎?
可以,Linkerd 與 NGINX 和 Traefik 等 ingress controllers 整合。您可能需要在 ServerAuthorization 中將 ingress 標記為 'unauthenticated' 以處理外部流量。
什麼是 ServiceProfile?
ServiceProfile 是一個 Linkerd custom resource,定義服務的 per-route metrics、重試、超時和 traffic splits。它啟用進階流量管理功能。
如何監控 Linkerd?
安裝 Linkerd Viz extension 以獲得內建儀表板。使用 'linkerd viz top' 查看即時流量,'linkerd viz stat' 查看 metrics,'linkerd viz edges' 查看服務依賴關係。

開發者詳情

檔案結構

📄 SKILL.md