下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“istio-traffic-management”。 创建一个 10% 流量的金丝雀部署
预期结果:
生成带有基于权重路由的 VirtualService(90% 稳定版本,10% 金丝雀版本��和定义带有版本标签的两个 subset 的 DestinationRule
正在使用“istio-traffic-management”。 为订单服务添加重试和超时
预期结果:
创建带有 3 次重试尝试、每次尝试 3 秒超时和 10 秒总体超时的订单主机 VirtualService
正在使用“istio-traffic-management”。 为结账服务设置断路器
预期结果:
生成带有连接池限制和异常检测的 DestinationRule,包括 consecutive5xxErrors 和 baseEjectionTime
安全审计
安全All static analysis findings are false positives. The skill contains only YAML configuration templates and documentation for Istio traffic management. The 'external commands' flagged are bash commands in markdown documentation blocks (istioctl commands). The 'weak cryptographic algorithm' warnings are triggered by Istio API version strings (v1beta1) in YAML headers, not actual crypto. The 'hardcoded URLs' are legitimate links to official Istio documentation. No executable code, no security risks, no prompt injection attempts detected.
低风险问题 (1)
质量评分
你能构建什么
平台工程师配置金丝雀部署
配置从稳定版本到金丝雀版本的渐进式流量推送,通过加权路由实现故障时自动回滚。
DevOps 工程师实施弹性模式
添加断路器、重试和超时机制,防止级联故障并提高服务可靠性。
SRE 调试流量路由问题
使用 istioctl 命令分析和验证生产集群中的 VirtualService 和 DestinationRule 配置。
试试这些提示
为 my-service 创建一个 VirtualService,根据 x-user header 路由流量。将 header 值为 'beta' 的用户发送到 v2 subset,其他所有用户发送到 v1。
为 payment-service 设置金丝雀部署。将 95% 的流量路由到稳定版本,5% 路由到金丝雀版本。包含带有两个 subset 的 DestinationRule。
为 api-service 创建带有断路器设置的 DestinationRule:最多 100 个连接,1000 个 HTTP 请求,5 次连续错误后弹出 pod,基础弹出时间 30 秒。
设置从生产到预发布环境的流量镜像。将 100% 的请求镜像到 v2 subset 进行测试,而不影响实时流量。
最佳实践
- 在应用配置到生产环境之前,始终使用 istioctl analyze 测试 Istio 配置
- 从简单的 VirtualService 规则开始,逐步增加复杂性
- 部署新路由规则后,使用 Kiali 仪表板监控流量模式
- 使用有意义的 subset 名称(stable、canary、v1、v2)并一致地为服务添��标签
避免
- 不要配置无限制的重试 - 这可能导致级联故障
- 避免将流量镜像到生产数据库 - 仅镜像到测试环境
- 永远不要跳过 DestinationRule 中的 subset 验证 - 未定义的 subset 会导致路由失败
- 不要立即使用 100% 金丝雀权重 - 始终从小百分比开始