Skip to content

feat: add common pod labels support#282

Open
suraj2410 wants to merge 3 commits intofrappe:mainfrom
suraj2410:feat/common-pod-labels
Open

feat: add common pod labels support#282
suraj2410 wants to merge 3 commits intofrappe:mainfrom
suraj2410:feat/common-pod-labels

Conversation

@suraj2410
Copy link
Copy Markdown

This PR introduces common pod labels support for ERPNext deployments, allowing the same labels to be applied to all pods across all deployments in a single Helm release.

What's included

  • ✅ Add commonPodLabels helper template for user-defined pod labels
  • ✅ Update all deployment templates to include common pod labels
  • ✅ Add commonPodLabels configuration to values.yaml with examples
  • ✅ Preserve all existing pod labels without modification

Key Features

  • Universal Application: Labels are automatically applied to all ERPNext deployments
  • Non-intrusive: All existing pod labels remain completely untouched
  • Backwards Compatible: Works with empty {} or missing commonPodLabels configuration
  • Flexible: Supports any number of custom key-value label pairs

Usage Example

commonPodLabels:
  environment: production
  team: platform
  cost-center: engineering
  monitoring: enabled
  app-version: v16.8.0

Backward compatibility

  • ✅ No existing values or workflows are broken
  • ✅ All original pod labels preserved exactly as they were
  • ✅ Upgrading users can opt in to common pod labels without changing current setups
  • ✅ Works with empty configuration
    Testing
    All deployments (nginx, gunicorn, socketio, scheduler, workers) will now include:
  • Existing labels: app.kubernetes.io/name, app.kubernetes.io/instance, app.kubernetes.io/app: frappe (untouched)
  • Custom labels: Your common labels from values.commonPodLabels
    Fixes common requirement for applying organization-wide labels to Kubernetes resources.

- Add erpnext.commonPodLabels template for user-defined pod labels
- Template only includes custom labels, preserves existing labels
- Returns empty string when commonPodLabels is not defined
- Update all deployment templates to include commonPodLabels
- Add commonPodLabels as separate block after existing pod labels
- Preserve original labels (app.kubernetes.io/name, instance, app: frappe)
- Apply to all components: nginx, gunicorn, socketio, scheduler, workers
- Add commonPodLabels section with comprehensive documentation
- Provide clear examples for common use cases (environment, team, etc.)
- Default to empty object for backward compatibility
- Include usage examples in comments
@ismxilxrif
Copy link
Copy Markdown
Contributor

@suraj2410 this is actually good, how about putting it under a key called global? we can later add other things such as annotations, tolerations etc for the whole deployment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants