云原生基础设施。Kubernetes、Helm、Kustomize、Operator、CRD、GitOps、ArgoCD、Flux、IaC、Terraform、Pulumi、CDK。当用户提到 K8s、Helm、GitOps、IaC 时路由到此。
61
71%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./templates/skills/domains/infrastructure/SKILL.mdGitOps 控制平面
|
+-----------------+-----------------+
| | |
ArgoCD/Flux Kubernetes IaC 层
| | |
Git Repo ------> Helm/Kustomize --> Terraform/Pulumi
| | |
声明式配置 容器编排 云资源管理标准结构:Chart.yaml + values.yaml + templates/ + charts/
核心要点:
apiVersion: v2, dependencies 声明子 Chart(condition 控制启用)_helpers.tpl 定义 fullname / labels / selectorLabelschecksum/config: {{ include ... | sha256sum }} 触发滚动更新runAsNonRoot: true, runAsUser: 1000关键命令:
helm lint / helm template --debug 验证helm install -f values-prod.yaml 部署helm upgrade --reuse-values 升级helm rollback <release> <revision> 回滚helm push <chart>.tgz oci://registry 推送 OCI目录结构:base/ + overlays/{dev,staging,production}/
核心能力:
kubectl apply -k overlays/production / kubectl diff -koperator-sdk init → create api → make manifests → make install| 策略 | 实现方式 | 适用场景 |
|---|---|---|
| 滚动更新 | strategy.rollingUpdate maxSurge/maxUnavailable | 默认策略 |
| 蓝绿部署 | 两个 Deployment + Service selector 切换 | 零停机切换 |
| 金丝雀 | stable(9) + canary(1) 共享 Service | 渐进式验证 |
| Flagger | Canary CRD + 自动分析指标 | 自动化金丝雀 |
minAvailable 防止滚动更新中断| 特性 | ArgoCD | Flux |
|---|---|---|
| Web UI | 功能强大 | 无(可用 Weave GitOps) |
| 多租户 | Projects + RBAC | 需额外配置 |
| 多集群 | 原生支持 | 原生支持 |
| 镜像自动更新 | 需 Image Updater | 原生支持 |
| 渐进式交付 | Argo Rollouts | Flagger |
| CNCF | Graduated | Graduated |
automated(prune: true, selfHeal: true) + retry/spec/replicasargocd cluster add 注册集群Canary CRD + steps(setWeight/pause) + AnalysisTemplate(Prometheus 查询)interval: 1m, ref branch, secretReffleet-infra/
├── clusters/{dev,staging,production}/ # 每集群入口
├── infrastructure/base + overlays/ # 基础组件
└── apps/base + overlays/ # 应用配置kubeseal 加密 → 提交 Git → Controller 解密| 工具 | 语言 | 状态管理 | 云支持 | 学习曲线 |
|---|---|---|---|---|
| Terraform | HCL | 显式(S3/TF Cloud) | 全平台 | 中等 |
| Pulumi | Python/TS/Go | 自动(Pulumi Cloud) | 全平台 | 较低 |
| AWS CDK | Python/TS | CloudFormation | AWS | 中等 |
项目结构:modules/{vpc,eks,rds}/ + environments/{dev,staging,prod}/
required_providers + default_tagsvariable → resource → output,环境通过 module 引用data "terraform_remote_state" 跨模块引用init → validate → fmt → plan -out=tfplan → apply tfplanstate list/show/mv/rm / import 导入现有资源workspace new/select 多环境隔离pulumi.Config() 读取 stack 配置pulumi.export() 导出值preview → up → stack output / destroyStack,使用 L2 Constructs(ec2.Vpc / eks.Cluster)synth → diff → deploy --all / bootstrap| 层级 | 工具选择 | 原则 |
|---|---|---|
| 应用部署 | Helm + Kustomize | 模板化 + 环境差异 |
| 持续交付 | ArgoCD / Flux | Git 为唯一真相源 |
| 基础设施 | Terraform / Pulumi | 声明式 + 状态管理 |
| 配置管理 | External Secrets | 密钥外部化 |
| 可观测性 | Prometheus + Grafana | 指标 + 可视化 |
Kubernetes、K8s、Helm、Kustomize、Operator、CRD、GitOps、ArgoCD、Flux、IaC、Terraform、Pulumi、CDK、基础设施即代码
f349e3d
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.