技能 linkerd-patterns
🔗

linkerd-patterns

低风险 ⚙️ 外部命令🌐 网络访问

部署 Linkerd 服务网格

也可从以下获取: wshobson

此技能提供在 Kubernetes 上部署和配置 Linkerd 服务网格的生产就绪模式,支持自动 mTLS、流量管理和零信任安全策略。

支持: Claude Codex Code(CC)
📊 71 充足
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“linkerd-patterns”。 Install Linkerd on my Kubernetes cluster

预期结果:

以下是安装 Linkerd 的方法:

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

2. 验证您的集群:
linkerd check --pre

3. 安装 CRD:
linkerd install --crds | kubectl apply -f -

4. 安装控制平面:
linkerd install | kubectl apply -f -

5. 验证安装:
linkerd check

正在使用“linkerd-patterns”。 Create a canary deployment setup

预期结果:

以下是用于金丝雀部署的 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% 的流量路由到稳定版本,10% 路由到金丝雀版本。

正在使用“linkerd-patterns”。 How do I enable automatic retries?

预期结果:

创建具有重试配置的 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
内容
50
社区
78
安全
100
规范符合性

你能构建什么

DevOps 工程师设置服务网格

DevOps 工程师需要使用自动 mTLS 保护微服务通信,并为金丝雀部署实现流量分流。

安全工程师实施零信任

安全工程师希望使用 Linkerd 的 ServerAuthorization 限制服务间的流量,以强制执行零信任网络策略。

平台团队管理多集群

平台团队需要将 Linkerd 扩展到多个 Kubernetes 集群,以实现高可用性和灾难恢复。

试试这些提示

基本 Linkerd 安装
在我的 Kubernetes 集群上安装 Linkerd 并验证安装正常工作。
启用自动 mTLS
展示如何为命名空间 'my-app' 中的所有 Pod 启用自动 mTLS,并解释 Linkerd 如何处理证书轮换。
配置金丝雀部署
创建 TrafficSplit 配置,将 10% 的流量路由到 'my-service-canary',90% 的流量路由到 'my-service-stable',用于金丝雀部署。
设置服务授权
创建 ServerAuthorization 和 Server 资源,仅允许 'frontend' 服务帐户使用网格 TLS 在端口 8080 上访问 'my-service'。

最佳实践

  • 在任何配置更改后始终运行 'linkerd check' 以验证正确性
  • 为所有服务启用 ServiceProfile 以获取单路由指标并启用重试
  • 从宽松策略开始并逐步收紧;首先使用 Linkerd 的可见性来了解流量模式

避免

  • 使用 'linkerd check --pre' 跳过预安装检查
  • 在不了解对现有流量影响的情况下应用配置
  • 设置过于宽泛的 ServerAuthorization 策略,从而破坏零信任目标

常见问题

什么是 Linkerd?
Linkerd 是一个用于 Kubernetes 的服务网格,为微服务通信提供自动 mTLS、流量管理、可观察性和安全策略。
Linkerd 需要更改代码吗?
不需要,Linkerd 通过向 Pod 中注入代理 sidecar 来工作。大多数功能无需更改应用程序代码。
自动 mTLS 如何工作?
Linkerd 自动为所有 Pod 间通信颁发和轮换 TLS 证书。服务使用双向 TLS 相互验证,无需任何配置。
我可以将 Linkerd 与入口控制器一起使用吗?
是的,Linkerd 与 NGINX 和 Traefik 等入口控制器集成。您可能需要在 ServerAuthorization 中将入口标记为 'unauthenticated' 以允许外部流量。
什么是 ServiceProfile?
ServiceProfile 是一个 Linkerd 自定义资源,用于定义服务的单路由指标、重试、超时和流量分流。它启用高级流量管理功能。
如何监控 Linkerd?
安装 Linkerd Viz 扩展以获取内置仪表板���使用 'linkerd viz top' 查看实时流量���'linkerd viz stat' 查看指标,'linkerd viz edges' 查看服务依赖关系。

开发者详情

文件结构

📄 SKILL.md