Skip to main content 首页 创作者 lukaskellerstein codex-my-marketplace helm-charts
helm-charts Helm package manager for Kubernetes. Use when creating, managing, or debugging Helm charts, writing Chart.yaml or values.yaml files, templating K8s manifests with Go templates, managing Helm releases (install, upgrade, rollback), working with Helm repositories, creating chart libraries, or troubleshooting Helm deployment issues. Covers chart structure, values overrides, hooks, tests, dependencies, and OCI registry usage.
跳到安装 Skills Marketplace 发现并探索由社区构建的 Agent Skills
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/lukaskellerstein/codex-my-marketplace --skill helm-charts命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
下载 Zip 下载中... Create a feature branch following the git flow branching model, commit staged or unstaged changes with a well-crafted commit message, and open a GitHub Pull Request with a meaningful title, description, and assignee. Follows git flow conventions — branches are created from and merged back into `develop`, with `feature/`, `hotfix/`, `release/`, and `bugfix/` prefixes. Use this skill whenever the user wants to commit their work and raise a PR, says things like "commit and open a PR", "create a pull request for my changes", "push this to a branch", "ship this", "submit this for review", or any variation of wanting to save work and create a GitHub PR. Always use this skill even if the user only mentions one part (e.g. "just commit this") — the full branch-commit-PR flow is the default behavior.
ALWAYS use this skill when the user asks to create, draw, design, produce, or generate any visual asset that is not a photograph or illustration. Fires on words like diagram, chart, graph, flowchart, architecture, system map, topology, sequence diagram, state machine, class diagram, ER diagram, C4, UML, BPMN, mind map, org chart, wireframe, mockup, UI sketch, infographic, dashboard, treemap, sankey, heatmap, choropleth, network graph, map, plot, visualization, mermaid, d3, drawio, draw.io, .drawio, or any request to "visualize", "render", "show as a diagram", or produce .drawio / .png / .svg / .pdf architecture artifacts. Fires on domain phrasings like "AWS architecture", "Kubernetes namespaces", "microservices diagram", "identity/auth flow", "repo topology", "dev environment", "system context", "data flow", "pipeline diagram", "network topology", "P&ID", "wiring diagram". Routes to Mermaid for text-based docs diagrams, D3.js for data-driven charts/maps, and Draw.io for architecture/vendor-icon/editable deliv
name helm-charts description Helm package manager for Kubernetes. Use when creating, managing, or debugging Helm charts, writing Chart.yaml or values.yaml files, templating K8s manifests with Go templates, managing Helm releases (install, upgrade, rollback), working with Helm repositories, creating chart libraries, or troubleshooting Helm deployment issues. Covers chart structure, values overrides, hooks, tests, dependencies, and OCI registry usage.
Helm Package Manager
Comprehensive guidance for managing Kubernetes applications with Helm charts, from chart creation to production deployment patterns.
Quick Start
Basic operations
helm install my-release ./chart -n namespace
helm upgrade my-release ./chart -n namespace -f values.yaml
helm rollback my-release 1 -n namespace
helm uninstall my-release -n namespace
helm list -n namespace
helm list -A
Repository management
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm search repo nginx
helm search hub prometheus
Chart Structure
Standard layout
mychart/
├── Chart.yaml # Chart metadata (name, version, dependencies)
├── Chart.lock # Locked dependency versions
├── values.yaml # Default configuration values
├── values.schema.json # Optional JSON schema for values validation
├── templates/
│ ├── _helpers.tpl # Template helpers (named templates)
│ ├── deployment.yaml
│ ├── service.yaml
│ ├── ingress.yaml
│ ├── configmap.yaml
│ ├── secret.yaml
│ ├── hpa.yaml
│ ├── serviceaccount.yaml
│ ├── NOTES.txt # Post-install usage instructions
│ └── tests/
│ └── test-connection.yaml
├── charts/ # Dependency charts (vendored)
└── .helmignore # Files to exclude from packaging
Chart.yaml apiVersion: v2
name: my-app
description: A Helm chart for my application
type: application
version: 1.2 .0
appVersion: "3.1.0"
keywords:
- app
- backend
home: https://github.com/org/my-app
sources:
- https://github.com/org/my-app
maintainers:
- name: Team Name
email: team@example.com
dependencies:
- name: postgresql
version: "~13.0"
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled
- name: redis
version: "~18.0"
repository: https://charts.bitnami.com/bitnami
condition: redis.enabled
values.yaml
replicaCount: 2
image:
repository: gcr.io/my-project/my-app
tag: ""
pullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
create: true
annotations: {}
name: ""
service:
type: ClusterIP
port: 80
targetPort: 8080
ingress:
enabled: false
className: traefik
annotations: {}
hosts:
- host: app.example.com
paths:
- path: /
pathType: Prefix
tls: []
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 256Mi
autoscaling:
enabled: false
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 70
targetMemoryUtilizationPercentage: 80
env: []
envFrom: []
configMap:
enabled: false
data: {}
secret:
enabled: false
data: {}
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: http
initialDelaySeconds: 5
periodSeconds: 5
nodeSelector: {}
tolerations: []
affinity: {}
postgresql:
enabled: false
redis:
enabled: false
Go Templating
Template helpers (_helpers.tpl) {{/*
Expand the name of the chart.
*/ }}
{{- define "mychart.name" - }}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
*/ }}
{{- define "mychart.fullname" - }}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Common labels
*/ }}
{{- define "mychart.labels" - }}
helm.sh/chart: {{ include "mychart.chart" . }}
{{ include "mychart.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/ }}
{{- define "mychart.selectorLabels" - }}
app.kubernetes.io/name: {{ include "mychart.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Chart name and version as used by the chart label.
*/ }}
{{- define "mychart.chart" - }}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create the name of the service account to use
*/ }}
{{- define "mychart.serviceAccountName" - }}
{{- if .Values.serviceAccount.create }}
{{- default (include "mychart.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
Common template patterns
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
{{- end }}
{{- range .Values.env }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
image: "{{ .Values.image.repository }} :{{ .Values.image.tag | default .Chart.AppVersion }} "
{{- include "mychart.labels" . | nindent 4 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
replicas: {{ ternary 1 .Values.replicaCount .Values.autoscaling.enabled }}
{{ required "image.repository is required" .Values.image.repository }}
Deployment template apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "mychart.fullname" . }}
labels:
{{- include "mychart.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "mychart.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml" ) . | sha256sum }}
labels:
{{- include "mychart.labels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "mychart.serviceAccountName" . }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }} :{{ .Values.image.tag | default .Chart.AppVersion }} "
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.targetPort }}
protocol: TCP
{{- with .Values.env }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.envFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Values Management
Override strategies
helm install my-release ./chart -f values.yaml
helm install my-release ./chart \
-f values.yaml \
-f values-prod.yaml
helm install my-release ./chart \
-f values.yaml \
--set image.tag=v1.2.3 \
--set replicaCount=3
helm install my-release ./chart --set-string annotations."key" ="value"
helm install my-release ./chart --set-file config=./app-config.json
Environment-specific values pattern chart/
├── values.yaml # Defaults
├── values-dev.yaml # Dev overrides
├── values-staging.yaml # Staging overrides
└── values-prod.yaml # Production overrides
helm upgrade --install my-release ./chart \
-f values.yaml \
-f values-prod.yaml \
-n production
values.schema.json (validation) {
"$schema" : "https://json-schema.org/draft-07/schema#" ,
"type" : "object" ,
"required" : [ "image" , "service" ] ,
"properties" : {
"replicaCount" : {
"type" : "integer" ,
"minimum" : 1
} ,
"image" : {
"type" : "object" ,
"required" : [ "repository" ] ,
"properties" : {
"repository" : { "type" : "string" } ,
"tag" : { "type" : "string" } ,
"pullPolicy" : {
"type" : "string" ,
"enum" : [ "Always" , "IfNotPresent" , "Never" ]
}
}
}
}
}
Hooks
Pre/post install and upgrade hooks apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "mychart.fullname" . }}-db-migrate
annotations:
"helm.sh/hook": pre-upgrade,pre-install
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
template:
spec:
restartPolicy: Never
containers:
- name: migrate
image: "{{ .Values.image.repository }} :{{ .Values.image.tag | default .Chart.AppVersion }} "
command: ["python" , "manage.py" , "migrate" ]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: db-credentials
key: url
backoffLimit: 1
Hook types Hook Description pre-installBefore any resources are installed post-installAfter all resources are installed pre-upgradeBefore any resources are upgraded post-upgradeAfter all resources are upgraded pre-deleteBefore any resources are deleted post-deleteAfter all resources are deleted pre-rollbackBefore rollback post-rollbackAfter rollback testWhen helm test is invoked
Delete policies
before-hook-creation — delete previous hook resource before new one is created
hook-succeeded — delete after hook succeeds
hook-failed — delete after hook fails
Chart Tests
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "mychart.fullname" . }} -test-connection"
annotations:
"helm.sh/hook": test
spec:
restartPolicy: Never
containers:
- name: wget
image: busybox
command: ['wget' ]
args: ['{{ include "mychart.fullname" . }}:{{ .Values.service.port }}/healthz' ]
helm test my-release -n namespace
helm test my-release -n namespace --logs
Dependencies
Managing chart dependencies
helm dependency update ./chart
helm dependency list ./chart
helm dependency build ./chart
Conditional dependencies
dependencies:
- name: postgresql
version: "~13.0"
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled
tags:
- database
Overriding dependency values
postgresql:
enabled: true
auth:
postgresPassword: secret
database: myapp
primary:
persistence:
size: 10Gi
OCI Registry
Push and pull charts via OCI
helm registry login gcr.io -u _json_key --password-stdin < key.json
helm package ./chart
helm push my-app-1.2.0.tgz oci://gcr.io/my-project/charts
helm pull oci://gcr.io/my-project/charts/my-app --version 1.2.0
helm install my-release oci://gcr.io/my-project/charts/my-app --version 1.2.0
Library Charts
Creating a library chart
apiVersion: v2
name: common-lib
type: library
version: 1.0 .0
{{- define "common-lib.deployment" - }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "common-lib.fullname" . }}
labels:
{{- include "common-lib.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "common-lib.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "common-lib.selectorLabels" . | nindent 8 }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }} :{{ .Values.image.tag }} "
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- end }}
Using a library chart
dependencies:
- name: common-lib
version: "1.0.0"
repository: "file://../common-lib"
{{- include "common-lib.deployment" . }}
Release Management
Inspect releases
helm history my-release -n namespace
helm get values my-release -n namespace
helm get values my-release -n namespace -a
helm get manifest my-release -n namespace
helm get notes my-release -n namespace
helm get all my-release -n namespace
Upgrade patterns
helm upgrade my-release ./chart -n namespace \
-f values.yaml \
--atomic \
--timeout 5m
helm upgrade --install my-release ./chart -n namespace -f values.yaml
helm upgrade my-release ./chart -n namespace -f values.yaml --dry-run
helm diff upgrade my-release ./chart -n namespace -f values.yaml
Rollback
helm rollback my-release -n namespace
helm rollback my-release 3 -n namespace
helm rollback my-release 3 -n namespace --wait --timeout 5m
Debugging
helm template my-release ./chart -f values.yaml
helm template my-release ./chart -f values.yaml --debug
helm install my-release ./chart -f values.yaml --dry-run --debug
helm lint ./chart
helm lint ./chart -f values.yaml
helm show values ./chart
helm show chart ./chart
helm show readme ./chart
Common issues Template rendering errors:
helm template my-release ./chart -s templates/deployment.yaml
helm template my-release ./chart | kubectl apply --dry-run=client -f -
Release stuck in pending/failed:
helm status my-release -n namespace
helm uninstall my-release -n namespace --no-hooks
kubectl delete secret -l owner=helm,name=my-release -n namespace
Best Practices
Use helm upgrade --install for idempotent deployments
Use --atomic in CI/CD to auto-rollback failed upgrades
Pin chart versions in dependencies — avoid floating versions
Use values.schema.json to validate values before rendering
Include NOTES.txt with post-install instructions
Use named templates in _helpers.tpl — avoid duplication across templates
Add checksum annotations for ConfigMaps/Secrets to trigger pod restart on config changes
Test charts with helm lint, helm template, and helm test
Separate chart version from app version — bump chart version for chart changes, appVersion for application changes
Use .helmignore to exclude CI files, tests, and docs from packaged chart
Package Requirements
helm >= 3.0 — Kubernetes package manager
kubectl — for cluster access and validation
Optional: helm-diff plugin — for previewing upgrade changes