重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
helm-values-management by laurigates/claude-plugins
npx skills add https://github.com/laurigates/claude-plugins --skill helm-values-management跨环境管理 Helm 值的综合指南,理解覆盖优先级和高级配置策略。
在以下情况自动使用此技能:
值以 最右侧优先级 合并(后定义的胜出):
1. Chart 默认值(chart 中的 values.yaml)
↓
2. 父 Chart 值(如果是子 chart)
↓
3. 先前发布的值(--reuse-values)
↓
4. 按顺序排列的值文件(-f values1.yaml -f values2.yaml)
↓
5. 单个覆盖项(--set, --set-string, --set-json, --set-file)
↑
最高优先级
# Chart values.yaml
replicaCount: 1
image:
tag: "1.0.0"
# -f base.yaml
replicaCount: 2
# -f production.yaml
image:
tag: "2.0.0"
# --set replicaCount=5
# 结果:
# replicaCount: 5 (来自 --set,最高优先级)
# image.tag: "2.0.0" (来自 production.yaml)
# 显示 chart 默认值
helm show values <chart>
# 显示特定 chart 版本的值
helm show values <chart> --version 1.2.3
# 将默认值保存到文件
helm show values bitnami/nginx > default-values.yaml
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 获取部署的发布中使用的值
helm get values <release> --namespace <namespace>
# 获取所有值(包括默认值)
helm get values <release> --namespace <namespace> --all
# 以不同格式获取值
helm get values <release> -n <namespace> -o json
# 从特定修订版本获取值
helm get values <release> -n <namespace> --revision 2
# 使用值文件
helm install myapp ./chart \
--namespace prod \
--values values.yaml
# 使用多个值文件(最右侧胜出)
helm install myapp ./chart \
--namespace prod \
-f values/base.yaml \
-f values/production.yaml
# 使用 --set 设置单个值
helm install myapp ./chart \
--namespace prod \
--set replicaCount=3 \
--set image.tag=v2.0.0
# 使用 --set-string 强制字符串类型
helm install myapp ./chart \
--namespace prod \
--set-string version="1.0"
# 使用 --set-json 处理复杂结构
helm install myapp ./chart \
--namespace prod \
--set-json 'nodeSelector={"disktype":"ssd","region":"us-west"}'
# 使用 --set-file 从文件读取值
helm install myapp ./chart \
--namespace prod \
--set-file tlsCert=./certs/tls.crt
# 重用现有值,与新值合并
helm upgrade myapp ./chart \
--namespace prod \
--reuse-values \
--set image.tag=v2.0.0
# 重置为 chart 默认值,忽略现有值
helm upgrade myapp ./chart \
--namespace prod \
--reset-values \
-f new-values.yaml
project/
├── charts/
│ └── myapp/ # Helm chart
│ ├── Chart.yaml
│ ├── values.yaml # Chart 默认值
│ └── templates/
└── values/ # 环境特定值
├── common.yaml # 所有环境共享
├── dev.yaml # 开发环境覆盖
├── staging.yaml # 预发布环境覆盖
├── production.yaml # 生产环境覆盖
└── secrets/ # 敏感值(gitignored)
├── dev.yaml
├── staging.yaml
└── production.yaml
# 所有环境共享的配置
app:
name: myapp
labels:
team: platform
component: api
service:
type: ClusterIP
port: 8080
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt
resources:
requests:
cpu: 100m
memory: 128Mi
# 部署到开发环境
helm upgrade --install myapp ./charts/myapp \
--namespace dev \
--create-namespace \
-f values/common.yaml \
-f values/dev.yaml \
-f values/secrets/dev.yaml
# 部署到预发布环境
helm upgrade --install myapp ./charts/myapp \
--namespace staging \
--create-namespace \
-f values/common.yaml \
-f values/staging.yaml \
-f values/secrets/staging.yaml \
--atomic --wait
# 部署到生产环境
helm upgrade --install myapp ./charts/myapp \
--namespace production \
--create-namespace \
-f values/common.yaml \
-f values/production.yaml \
-f values/secrets/production.yaml \
--atomic --wait --timeout 10m
# 字符串
name: myapp
tag: "v1.0.0" # 使用引号确保是字符串
# 数字
replicaCount: 3
port: 8080
# 布尔值
enabled: true
debug: false
# 空值
database: null
# 嵌套对象
image:
repository: nginx
tag: "1.21.0"
pullPolicy: IfNotPresent
# 在模板中访问:{{ .Values.image.repository }}
# 简单列表
tags:
- api
- web
- production
# 对象列表
env:
- name: DATABASE_URL
value: postgres://db:5432/myapp
- name: REDIS_URL
value: redis://cache:6379
# 简单值
--set name=myapp
# 嵌套值(使用点号表示法)
--set image.tag=v2.0.0
--set ingress.annotations."cert-manager\.io/cluster-issuer"=letsencrypt
# 列表值(使用数组索引或 {})
--set tags={api,web,prod}
# 复杂 JSON 结构
--set-json 'nodeSelector={"disk":"ssd","region":"us-west"}'
# 强制字符串(防止数字转换)
--set-string version="1.0"
# 从文件读取值
--set-file cert=./tls.crt
# 使用值渲染模板
helm template myapp ./chart --values values.yaml
# 针对 Kubernetes API 验证
helm install myapp ./chart \
--values values.yaml \
--dry-run --validate
# 查看将使用的值(安装前)
helm template myapp ./chart \
--values values.yaml \
--debug 2>&1 | grep -A 100 "COMPUTED VALUES"
# 查看已使用的值(安装后)
helm get values myapp --namespace prod --all
# 使用最小值测试
helm template myapp ./chart --set image.tag=test
# 使用完整生产值测试
helm template myapp ./chart \
-f values/common.yaml \
-f values/production.yaml
有关详细的环境值示例、模式验证 JSON、密钥管理选项、模板值处理模式、最佳实践和故障排除,请参阅 REFERENCE.md。
| 上下文 | 命令 |
|---|---|
| 查看值(JSON) | helm get values <release> -n <ns> -o json |
| 所有值(JSON) | helm get values <release> -n <ns> --all -o json |
| 计算后的值 | `helm template myapp ./chart -f values.yaml --debug 2>&1 |
| 验证模式 | `helm install myapp ./chart -f values.yaml --dry-run 2>&1 |
每周安装次数
56
仓库
GitHub 星标数
19
首次出现
2026年1月29日
安全审计
安装于
github-copilot55
opencode55
amp54
codex54
kimi-cli54
gemini-cli54
Comprehensive guidance for managing Helm values across environments, understanding override precedence, and advanced configuration strategies.
Use this skill automatically when:
Values are merged with right-most precedence (last wins):
1. Chart defaults (values.yaml in chart)
↓
2. Parent chart values (if subchart)
↓
3. Previous release values (--reuse-values)
↓
4. Values files in order (-f values1.yaml -f values2.yaml)
↓
5. Individual overrides (--set, --set-string, --set-json, --set-file)
↑
HIGHEST PRECEDENCE
# Chart values.yaml
replicaCount: 1
image:
tag: "1.0.0"
# -f base.yaml
replicaCount: 2
# -f production.yaml
image:
tag: "2.0.0"
# --set replicaCount=5
# RESULT:
# replicaCount: 5 (from --set, highest precedence)
# image.tag: "2.0.0" (from production.yaml)
# Show chart default values
helm show values <chart>
# Show values from specific chart version
helm show values <chart> --version 1.2.3
# Save defaults to file
helm show values bitnami/nginx > default-values.yaml
# Get values used in deployed release
helm get values <release> --namespace <namespace>
# Get ALL values (including defaults)
helm get values <release> --namespace <namespace> --all
# Get values in different formats
helm get values <release> -n <namespace> -o json
# Get values from specific revision
helm get values <release> -n <namespace> --revision 2
# Using values file
helm install myapp ./chart \
--namespace prod \
--values values.yaml
# Using multiple values files (right-most wins)
helm install myapp ./chart \
--namespace prod \
-f values/base.yaml \
-f values/production.yaml
# Using --set for individual values
helm install myapp ./chart \
--namespace prod \
--set replicaCount=3 \
--set image.tag=v2.0.0
# Using --set-string to force string type
helm install myapp ./chart \
--namespace prod \
--set-string version="1.0"
# Using --set-json for complex structures
helm install myapp ./chart \
--namespace prod \
--set-json 'nodeSelector={"disktype":"ssd","region":"us-west"}'
# Using --set-file to read value from file
helm install myapp ./chart \
--namespace prod \
--set-file tlsCert=./certs/tls.crt
# Reuse existing values, merge with new
helm upgrade myapp ./chart \
--namespace prod \
--reuse-values \
--set image.tag=v2.0.0
# Reset to chart defaults, ignore existing values
helm upgrade myapp ./chart \
--namespace prod \
--reset-values \
-f new-values.yaml
project/
├── charts/
│ └── myapp/ # Helm chart
│ ├── Chart.yaml
│ ├── values.yaml # Chart defaults
│ └── templates/
└── values/ # Environment-specific values
├── common.yaml # Shared across all environments
├── dev.yaml # Development overrides
├── staging.yaml # Staging overrides
├── production.yaml # Production overrides
└── secrets/ # Sensitive values (gitignored)
├── dev.yaml
├── staging.yaml
└── production.yaml
# Shared configuration across all environments
app:
name: myapp
labels:
team: platform
component: api
service:
type: ClusterIP
port: 8080
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt
resources:
requests:
cpu: 100m
memory: 128Mi
# Deploy to dev
helm upgrade --install myapp ./charts/myapp \
--namespace dev \
--create-namespace \
-f values/common.yaml \
-f values/dev.yaml \
-f values/secrets/dev.yaml
# Deploy to staging
helm upgrade --install myapp ./charts/myapp \
--namespace staging \
--create-namespace \
-f values/common.yaml \
-f values/staging.yaml \
-f values/secrets/staging.yaml \
--atomic --wait
# Deploy to production
helm upgrade --install myapp ./charts/myapp \
--namespace production \
--create-namespace \
-f values/common.yaml \
-f values/production.yaml \
-f values/secrets/production.yaml \
--atomic --wait --timeout 10m
# String
name: myapp
tag: "v1.0.0" # Quote to ensure string
# Number
replicaCount: 3
port: 8080
# Boolean
enabled: true
debug: false
# Null
database: null
# Nested objects
image:
repository: nginx
tag: "1.21.0"
pullPolicy: IfNotPresent
# Access in template: {{ .Values.image.repository }}
# Simple list
tags:
- api
- web
- production
# List of objects
env:
- name: DATABASE_URL
value: postgres://db:5432/myapp
- name: REDIS_URL
value: redis://cache:6379
# Simple value
--set name=myapp
# Nested value (use dot notation)
--set image.tag=v2.0.0
--set ingress.annotations."cert-manager\.io/cluster-issuer"=letsencrypt
# List values (use array index or {})
--set tags={api,web,prod}
# Complex JSON structures
--set-json 'nodeSelector={"disk":"ssd","region":"us-west"}'
# Force string (prevents numeric conversion)
--set-string version="1.0"
# Read value from file
--set-file cert=./tls.crt
# Render templates with values
helm template myapp ./chart --values values.yaml
# Validate against Kubernetes API
helm install myapp ./chart \
--values values.yaml \
--dry-run --validate
# See what values will be used (before install)
helm template myapp ./chart \
--values values.yaml \
--debug 2>&1 | grep -A 100 "COMPUTED VALUES"
# See what values were used (after install)
helm get values myapp --namespace prod --all
# Test with minimal values
helm template myapp ./chart --set image.tag=test
# Test with full production values
helm template myapp ./chart \
-f values/common.yaml \
-f values/production.yaml
For detailed environment value examples, schema validation JSON, secret management options, template value handling patterns, best practices, and troubleshooting, see REFERENCE.md.
| Context | Command |
|---|---|
| View values (JSON) | helm get values <release> -n <ns> -o json |
| All values (JSON) | helm get values <release> -n <ns> --all -o json |
| Computed values | `helm template myapp ./chart -f values.yaml --debug 2>&1 |
| Validate schema | `helm install myapp ./chart -f values.yaml --dry-run 2>&1 |
Weekly Installs
56
Repository
GitHub Stars
19
First Seen
Jan 29, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot55
opencode55
amp54
codex54
kimi-cli54
gemini-cli54
Azure 配额管理指南:服务限制、容量验证与配额增加方法
138,600 周安装