Infrastructure logo

Infrastructure

CommunityPopular
fengshao1227
infrastructure

云原生基础设施。Kubernetes、Helm、Kustomize、Operator、CRD、GitOps、ArgoCD、Flux、IaC、Terraform、Pulumi、CDK。当用户提到 K8s、Helm、GitOps、IaC 时路由到此。

Overview

Publisherfengshao1227
Repositoryccg-workflow
Skill nameinfrastructure
Stars
5.9K
Forks
446
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by fengshao1227 on GitHub. Read the source before you install it.

Installation

Install the Infrastructure AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/fengshao1227/ccg-workflow.git /tmp/ccg-workflow
mkdir -p .claude/skills
cp -r /tmp/ccg-workflow/templates/skills/domains/infrastructure .claude/skills/infrastructure
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Infrastructure in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Infrastructure on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Infrastructure is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

云原生基础设施 · Infrastructure

域概览

                    GitOps 控制平面
                          |
        +-----------------+-----------------+
        |                 |                 |
    ArgoCD/Flux      Kubernetes         IaC 层
        |                 |                 |
   Git Repo ------> Helm/Kustomize --> Terraform/Pulumi
        |                 |                 |
    声明式配置        容器编排          云资源管理

Kubernetes 容器编排

Helm Chart 开发

标准结构:Chart.yaml + values.yaml + templates/ + charts/

核心要点:

  • Chart.yaml:apiVersion: v2, dependencies 声明子 Chart(condition 控制启用)
  • values.yaml 设计:image / replicaCount / resources / autoscaling / service / ingress / probes / env / persistence
  • Deployment 模板:使用 _helpers.tpl 定义 fullname / labels / selectorLabels
  • 配置校验:checksum/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

Kustomize 配置管理

目录结构:base/ + overlays/{dev,staging,production}/

核心能力:

  • base/kustomization.yaml:resources / commonLabels / images / configMapGenerator / secretGenerator
  • overlay:namespace / patchesStrategicMerge / patchesJson6902 / replicas / images / configMapGenerator(behavior: merge)
  • 命令:kubectl apply -k overlays/production / kubectl diff -k

Operator 模式

  • CRD 定义:openAPIV3Schema 声明 spec/status,subresources(status/scale)
  • Controller 核心循环:Get CR → 构建期望状态 → Create/Update 子资源 → 更新 Status
  • OwnerReferences:子资源关联 CR,级联删除
  • 初始化:operator-sdk initcreate apimake manifestsmake install

部署策略

策略实现方式适用场景
滚动更新strategy.rollingUpdate maxSurge/maxUnavailable默认策略
蓝绿部署两个 Deployment + Service selector 切换零停机切换
金丝雀stable(9) + canary(1) 共享 Service渐进式验证
FlaggerCanary CRD + 自动分析指标自动化金丝雀

K8s Checklist

  • 健康检查:livenessProbe + readinessProbe 必配
  • 资源限制:requests + limits 防止资源耗尽
  • HPA:CPU/Memory/自定义指标自动扩缩容
  • PDB:minAvailable 防止滚动更新中断
  • ResourceQuota + LimitRange:命名空间资源配额
  • 镜像使用 Digest 确保一致性
  • Pod 反亲和性分散到不同节点
  • 密钥外部化:External Secrets Operator

GitOps 持续部署

ArgoCD vs Flux

特性ArgoCDFlux
Web UI功能强大无(可用 Weave GitOps)
多租户Projects + RBAC需额外配置
多集群原生支持原生支持
镜像自动更新需 Image Updater原生支持
渐进式交付Argo RolloutsFlagger
CNCFGraduatedGraduated

ArgoCD 核心模式

  • Application:source(repoURL/path/targetRevision) + destination(server/namespace)
  • syncPolicy:automated(prune: true, selfHeal: true) + retry
  • ignoreDifferences:忽略 HPA 修改的 /spec/replicas
  • ApplicationSet:Git 目录生成器,一套模板管理多环境
  • 多集群:argocd cluster add 注册集群
  • Notifications:ConfigMap 配置 Slack/Email 通知模板
  • Rollouts:Canary CRD + steps(setWeight/pause) + AnalysisTemplate(Prometheus 查询)

Flux 核心模式

  • GitRepository:interval: 1m, ref branch, secretRef
  • Kustomization:path + prune + healthChecks + postBuild substitute
  • HelmRepository + HelmRelease:chart + values + install/upgrade remediation
  • ImageRepository + ImagePolicy + ImageUpdateAutomation:自动检测新镜像并提交 Git

多环境管理

fleet-infra/
├── clusters/{dev,staging,production}/  # 每集群入口
├── infrastructure/base + overlays/     # 基础组件
└── apps/base + overlays/              # 应用配置

密钥管理

  • Sealed Secrets:kubeseal 加密 → 提交 Git → Controller 解密
  • External Secrets Operator:SecretStore(AWS SM) + ExternalSecret → 自动同步

GitOps Checklist

  • Git 为唯一真相源,所有变更通过 PR
  • 自动同步 + 自愈(selfHeal)
  • 密钥加密存储(Sealed Secrets / External Secrets)
  • 渐进式交付(Rollouts / Flagger)
  • 多环境目录隔离
  • 回滚策略:保留历史版本

基础设施即代码 (IaC)

工具对比

工具语言状态管理云支持学习曲线
TerraformHCL显式(S3/TF Cloud)全平台中等
PulumiPython/TS/Go自动(Pulumi Cloud)全平台较低
AWS CDKPython/TSCloudFormationAWS中等

Terraform 核心模式

项目结构:modules/{vpc,eks,rds}/ + environments/{dev,staging,prod}/

  • Provider:版本锁定 required_providers + default_tags
  • Backend:S3 + DynamoDB 锁 + KMS 加密
  • 模块化:variableresourceoutput,环境通过 module 引用
  • 远程状态:data "terraform_remote_state" 跨模块引用
  • 命令流:initvalidatefmtplan -out=tfplanapply tfplan
  • 状态管理:state list/show/mv/rm / import 导入现有资源
  • Workspace:workspace new/select 多环境隔离

Pulumi 核心模式

  • ComponentResource:自定义资源组(VPC/EKS 封装为类)
  • Config:pulumi.Config() 读取 stack 配置
  • Outputs:pulumi.export() 导出值
  • 命令:previewupstack output / destroy

AWS CDK 核心模式

  • Stack:继承 Stack,使用 L2 Constructs(ec2.Vpc / eks.Cluster
  • 跨 Stack 引用:通过构造函数参数传递
  • 命令:synthdiffdeploy --all / bootstrap

IaC Checklist

  • 模块化:可复用组件抽象为模块
  • 环境隔离:不同环境不同 State
  • 远程状态 + 状态锁定
  • Provider 版本锁定
  • 密钥管理:Secrets Manager / SSM
  • 统一资源标签
  • Plan 后人工审查再 Apply
  • CI/CD 集成自动化

最佳实践

层级工具选择原则
应用部署Helm + Kustomize模板化 + 环境差异
持续交付ArgoCD / FluxGit 为唯一真相源
基础设施Terraform / Pulumi声明式 + 状态管理
配置管理External Secrets密钥外部化
可观测性Prometheus + Grafana指标 + 可视化

触发词

Kubernetes、K8s、Helm、Kustomize、Operator、CRD、GitOps、ArgoCD、Flux、IaC、Terraform、Pulumi、CDK、基础设施即代码

Frequently asked questions

What does the Infrastructure AI skill do?

云原生基础设施。Kubernetes、Helm、Kustomize、Operator、CRD、GitOps、ArgoCD、Flux、IaC、Terraform、Pulumi、CDK。当用户提到 K8s、Helm、GitOps、IaC 时路由到此。

Why use Infrastructure on TypingMind?

Because you install it once and use it with any model. Infrastructure is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Infrastructure in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/fengshao1227/ccg-workflow/tree/main/templates/skills/domains/infrastructure. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Infrastructure?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Infrastructure?

As many as you like. As long as a model supports skills, you can use Infrastructure with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Infrastructure AI skill free?

Yes. It is published on GitHub by fengshao1227 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇