[BUG] Claude consistently suggests deprecated `commonLabels` in Kubernetes Kustomize configurations (Claude for Desktop, Claude Code)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude consistently recommends using the deprecated commonLabels field in Kubernetes Kustomize configurations, despite this field being deprecated in favor of labels. This leads to deprecation warnings when users run kustomize build or apply their configurations.
The Kustomize documentation and tooling have moved away from commonLabels in favor of the more flexible labels field. Claude's training data may include older examples that use the deprecated syntax.
What Should Happen?
Claude should recommend using the labels field instead of commonLabels in Kustomization files, as this is the current standard practice.
Error Messages/Logs
### Example Output from Claude
Claude often provides configurations like:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels: # This is deprecated
app: my-app
environment: production
resources:
- deployment.yaml
- service.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels: # Use this instead
- pairs:
app: my-app
environment: production
resources:
- deployment.yaml
- service.yaml
Kustomize output:
# Warning: 'commonLabels' is deprecated. Please use 'labels' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
Steps to Reproduce
- Ask Claude to create a Kustomize configuration for any given k8s resource
- Observe that Claude suggests using
commonLabelsin thekustomization.yaml - Run
kustomize buildon the generated configuration - Notice the deprecation warning
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
1.0.123
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Suggested Fix
Update Claude's knowledge base or prompt engineering to:
- Prioritize the labels field over commonLabels
- Add a note about the deprecation when commonLabels is mentioned
- Include examples using current Kustomize best practices
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗