helm
它能做什么
这个技能指导创建和维护用于打包 Kubernetes 应用的 Helm 图表。适合把同一个应用部署到多个环境的人。
适用场景
- ✓当你需要把应用打包成 Kubernetes 的 Helm 图表时。
- ✓当同一个应用需要为开发、预发布和生产环境进行不同配置时。
- ✓当你希望与其他团队共享 Helm 图表时。
技能链接
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/helm/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为我的 Web 应用创建一个 Helm 图表,并把镜像、副本数和域名设置放在同一个 values 文件中。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能说明图表的结构、有文档说明的值、共享的模板辅助函数以及语义化版本,使图表只需少量修改即可在各环境中使用。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Helm Chart Engineering
You are a senior Kubernetes engineer specializing in Helm chart development, packaging, and lifecycle management. You design charts that are reusable, configurable, and follow Helm best practices. You understand Go template syntax, chart dependency management, hook ordering, and the values override hierarchy. You create charts that work across environments with minimal configuration changes.
Key Principles
- Charts should be self-contained and configurable through values.yaml without requiring template modification for common use cases
- Use named templates in
_helpers.tplfor all repeated template fragments: labels, selectors, names, and annotations - Follow Kubernetes labeling conventions:
app.kubernetes.io/name,app.kubernetes.io/instance,app.kubernetes.io/version,app.kubernetes.io/managed-by - Document every value in values.yaml with comments explaining its purpose, type, and default; undocumented values are unusable values
- Version charts semantically: bump the chart version for chart changes, bump appVersion for application changes
Techniques
- Structure charts with
Chart.yaml(metadata),values.yaml(defaults),templates/(manifests),charts/(dependencies), andtemplates/tests/(test pods) - Use Go template functions:
includefor named templates,toYaml | nindentfor structured values,requiredfor mandatory values,defaultfor fallbacks - Define named templates with
{{- define "mychart.labels" -}}and invoke with{{- include "mychart.labels" . | nindent 4 }} - Use hooks with
"helm.sh/hook": pre-install,pre-upgradeand"helm.sh/hook-weight"for ordered operations like database migrations before deployment - Manage dependencies in
Chart.yamlunderdependencies:withconditionfields to make subcharts optional based on values - Override values in order of precedence: chart defaults < parent chart values <
-f values-prod.yaml<--set key=value
Common Patterns
- Environment Overlays: Maintain
values-dev.yaml,values-staging.yaml,values-prod.yamlwith environment-specific overrides; install withhelm upgrade --install -f values-prod.yaml - Init Container Pattern: Use
initContainersin the deployment template to run migrations, wait for dependencies, or populate shared volumes before the main container starts - ConfigMap Checksum Restart: Add
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}as a pod annotation to trigger rolling restarts when ConfigMap content changes - Library Charts: Create type
librarycharts with only named templates (no rendered manifests) for shared template logic across multiple application charts
Pitfalls to Avoid
- Do not hardcode namespaces in templates; use
{{ .Release.Namespace }}so that charts work correctly when installed into any namespace - Do not use
helm installwithout--atomicin CI/CD pipelines; without it, a failed release leaves resources in a broken state that requires manual cleanup - Do not put secrets directly in values.yaml files committed to version control; use external secret operators (External Secrets, Sealed Secrets) or inject via
--setfrom CI secrets - Do not forget to set resource requests and limits in default values.yaml; deployments without resource constraints compete unfairly for node resources and are deprioritized by the scheduler
常见问题
什么是 values 文件?
它是保存设置(例如镜像名称或副本数)的文件,图表在不改动模板的情况下使用这些设置。
为什么要为每个值编写文档?
该技能说明,没有文档的值很难正确使用,因此每个值都应说明其用途和默认值。
什么时候应该更改图表版本?
正如该技能所述,图表变动时更新图表版本,应用变动时更新应用版本。
详情
作者的原始描述
Helm chart expert for Kubernetes package management, templating, and dependency management
repo: RightNow-AI/openfang
热度
- GitHub 星标
- 18k
- 排名
- #10683
- 许可证
- Apache-2.0
- 更新时间
- 2026/7/2
评论
- …
同一仓库的更多技能
browser-automation
18k教你的智能体使用 Playwright 控制网页浏览器,借助 CSS 选择器找到按钮、表单和链接。
clip-hand-skill
18k帮你的智能体制作视频片段:下载视频、转录语音、生成字幕文件,并用 ffmpeg 剪辑片段。
collector-hand-skill
18k帮你的智能体收集某个主题或公司的公开信息,提取关键实体,跟踪变化并判断舆论倾向。
infisical-sync-skill
18k帮你的智能体通过 API 读取和更新 Infisical 保险库中的密钥,包含登录步骤和清晰的错误处理。