| name | helm-chart-review |
| description | Use when performing code reviews of Helm charts, conducting security audits of charts, assessing chart quality and best practices, running automated chart analysis tools, or validating chart structure and organization |
Helm Chart Review
Review Helm charts including security, quality, best practices, and code review guidelines.
Keywords
helm, chart, review, reviewing, security, quality, auditing, audit, best practices, code review, trivy, kubescape, polaris, pluto, lint, linting, validating, validation, analyzing, analysis
When to Use This Skill
- Performing code reviews of Helm charts
- Conducting security audits of charts
- Assessing chart quality and best practices
- Running automated chart analysis tools
- Validating chart structure and organization
Related Skills
Quick Reference
| Task | Command |
|---|
| Lint chart | helm lint mychart/ --strict |
| Security scan | trivy config mychart/ |
| Best practices | helm template myrelease mychart/ | polaris audit --audit-path - |
| Deprecated APIs | helm template myrelease mychart/ | pluto detect - |
| NSA framework | helm template myrelease mychart/ | kubescape scan framework nsa - |
Review Checklist
Structure & Organization
Values Design
Security
Quality
Security Review
Pod Security Checklist
podSecurityContext:
runAsNonRoot: true
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
capabilities:
drop:
- ALL
Security Anti-Patterns
securityContext:
privileged: true
securityContext:
runAsUser: 0
securityContext:
readOnlyRootFilesystem: false
hostNetwork: true
hostPID: true
hostIPC: true
volumes:
- name: host
hostPath:
path: /
env:
- name: DB_PASSWORD
value: "hardcoded-password"
resources: {}
RBAC Review
rules:
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "list", "watch"]
resourceNames: ["my-config"]
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
kind: ClusterRole
Image Security
image:
repository: myapp
tag: "v1.2.3"
image:
repository: myapp
tag: "latest"
image:
repository: myapp@sha256:abc123...
Quality Review
Template Quality
metadata:
name: {{ include "myapp.fullname" . }}
labels:
{{- include "myapp.labels" . | nindent 4 }}
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}
labels:
app: {{ .Chart.Name }}
release: {{ .Release.Name }}
Whitespace & Formatting
spec:
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 4 }}
{{- end }}
Conditional Resources
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
...
{{- end }}
image: {{ required "image.repository is required" .Values.image.repository }}
image: {{ .Values.image.repository }}
Labels & Annotations
metadata:
labels:
app.kubernetes.io/name: {{ include "myapp.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "myapp.chart" . }}
metadata:
labels:
app: myapp
version: v1
Values Review
Documentation
replicaCount: 1
image:
repository: myapp
pullPolicy: IfNotPresent
replicaCount: 1
image:
repository: myapp
pullPolicy: IfNotPresent
Defaults
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
securityContext:
runAsNonRoot: true
readOnlyRootFilesystem: true
resources: {}
securityContext: {}
Schema Validation
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["image"],
"properties": {
"replicaCount": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"image": {
"type": "object",
"required": ["repository"],
"properties": {
"repository": {
"type": "string",
"minLength": 1
},
"pullPolicy": {
"type": "string",
"enum": ["Always", "IfNotPresent", "Never"]
}
}
}
}
}
Code Review Comments
Severity Levels
| Level | Description | Action |
|---|
| 🔴 Critical | Security vulnerability, data loss risk | Must fix before merge |
| 🟠 Major | Best practice violation, significant issue | Should fix |
| 🟡 Minor | Style, minor improvement | Nice to have |
| 🔵 Suggestion | Alternative approach | Consider |
Example Review Comments
🔴 **Critical: Security - Privileged Container**
The container is running as privileged which grants full host access.
```yaml
# Current
securityContext:
privileged: true
# Suggested
securityContext:
privileged: false
allowPrivilegeEscalation: false
🟠 Major: Missing Resource Limits
No resource limits defined. This can lead to resource starvation.
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
🟡 Minor: Use nindent instead of indent
nindent handles newlines automatically and is more reliable.
{{ toYaml .Values.labels | indent 4 }}
{{- toYaml .Values.labels | nindent 4 }}
🔵 Suggestion: Consider using a helper
This pattern is repeated in multiple templates. Consider extracting to _helpers.tpl.
## Automated Review Tools
### helm lint
```bash
# Basic linting
helm lint mychart/
# Strict mode
helm lint mychart/ --strict
# With values
helm lint mychart/ -f values-production.yaml
Trivy (Security)
trivy config mychart/
trivy config mychart/ -f json -o results.json
Kubescape
helm template myrelease mychart/ | kubescape scan -
helm template myrelease mychart/ | kubescape scan framework nsa -
Polaris
helm template myrelease mychart/ | polaris audit --audit-path -
Pluto (Deprecations)
helm template myrelease mychart/ | pluto detect -
Review Process
Before Review
- Run
helm lint locally
- Run
helm template to verify rendering
- Run security scans (Trivy, Kubescape)
- Run unit tests
During Review
- Check structure and organization
- Review values.yaml design
- Audit security settings
- Verify template quality
- Check documentation
After Review
- Verify all critical issues addressed
- Re-run automated checks
- Test deployment in dev environment
- Approve or request changes
Review Template
## Helm Chart Review: [chart-name] v[version]
### Summary
[Brief description of changes]
### Automated Checks
- [ ] `helm lint` passes
- [ ] `helm template` renders correctly
- [ ] Unit tests pass
- [ ] Security scan clean (Trivy/Kubescape)
- [ ] No deprecated APIs (Pluto)
### Manual Review
- [ ] Chart structure follows conventions
- [ ] Values documented and have sensible defaults
- [ ] Security contexts properly configured
- [ ] Resource limits defined
- [ ] RBAC follows least privilege
- [ ] Labels follow Kubernetes conventions
- [ ] README accurate and complete
### Issues Found
| Severity | Issue | Location |
|----------|-------|----------|
| 🔴 | ... | ... |
| 🟠 | ... | ... |
### Recommendation
[ ] ✅ Approve
[ ] 🔄 Request changes
[ ] ❌ Reject