Skip to content

Conversation

@bogdanjeler-ev
Copy link

Description

This PR adds a new psmdb-operator-crds sub-chart that allows CRDs to be managed and upgraded via Helm.

Problem

Helm's built-in CRD handling (via the crds/ directory) only installs CRDs on initial helm install and never upgrades them on helm upgrade. This requires users to manually run kubectl apply for CRD upgrades and prevents GitOps tools (ArgoCD, FluxCD) from managing CRDs declaratively.

Resolves percona/percona-server-mongodb-operator#1716

Solution

Add a standalone CRD chart (psmdb-operator-crds) that places CRDs in templates/ instead of crds/, enabling:

  • CRD upgrades via helm upgrade
  • GitOps compatibility with Server-Side Apply
  • Separate CRD lifecycle management

Usage

Default (backward compatible):

helm install psmdb-operator percona/psmdb-operator

With CRD sub-chart enabled:

helm install psmdb-operator percona/psmdb-operator --set crds.enabled=true

Separate CRD installation (recommended for GitOps):

helm install psmdb-crds percona/psmdb-operator-crds
helm install psmdb-operator percona/psmdb-operator

Changes

  • Added charts/psmdb-operator-crds/ - new standalone CRD chart
  • Added crds.enabled option to psmdb-operator chart (default: false)
  • Added psmdb-operator-crds as conditional dependency in psmdb-operator/Chart.yaml
  • Updated all chart versions to 1.22.0 for compatibility with release branch

Backward Compatibility

Fully backward compatible. Existing installations continue to work unchanged. The crds/ directory remains for users who don't opt into the new method.

@it-percona-cla
Copy link

it-percona-cla commented Jan 6, 2026

CLA assistant check
All committers have signed the CLA.

- Create psmdb-operator-crds sub-chart with individual CRD templates
- Add CRD sub-chart as optional dependency in psmdb-operator Chart.yaml
- Add crds.enabled configuration option (default: false for backward compatibility)
- Update README with CRD upgrade instructions
- Move crds section to end of values.yaml for better organization
- Follows Everest pattern for consistency across Percona charts

This allows users to:
- Upgrade CRDs via helm upgrade (previously not possible)
- Install CRDs separately for better lifecycle management
- Use with GitOps tools (ArgoCD, FluxCD) that support server-side apply

Resolves: K8SPSMDB-1470
- Add 'Important Limitation' section explaining CRD ownership metadata issue
- Add troubleshooting section with exact error messages and solutions
- Add warning in operator README about enabling crds.enabled=true with existing CRDs
- Provide clear guidance on when and how to take ownership of existing CRDs

This helps users understand why enabling crds.enabled=true fails when CRDs
were previously installed via the crds/ directory and provides solutions.
…tibility

- Update psmdb-db chart to version 1.22.0
- Update psmdb-operator chart to version 1.22.0
- Update psmdb-operator-crds chart to version 1.22.0
- Update all version references in README files
- Update default image tags in values.yaml files
- Merge revisionHistoryLimit parameter from target branch
- Keep maxConcurrentReconciles parameter from feature branch
- Remove duplicate podAnnotations entry
- Use consistent formatting from target branch
@bogdanjeler-ev bogdanjeler-ev force-pushed the K8SPSMDB-1470-for-release-1.22.0 branch from 3eca6a7 to f105268 Compare January 7, 2026 10:18
…add validation

- Sync charts/psmdb-operator/crds/crd.yaml with CRD templates
- Remove 'Recommended for Production' language from READMEs (first release)
- Add GitHub Action to validate CRD sync on PRs
- Add note about default behavior discussion in values.yaml
- Ensure CRD files stay in sync for future releases
Only run validation on pull requests, not on pushes to main branch.
- Validate that psmdb-operator-crds chart version matches operator appVersion
- Validate that CRD chart appVersion matches operator appVersion
- Validate that dependency version matches CRD chart version
- Add clear notes that this rule applies ONLY to psmdb-operator-crds
- Other charts (e.g., psmdb-db) can have independent chart versions
The original crd.yaml file concatenates CRDs directly without '---' separators
or newlines between them (format: 'status: {}apiVersion: ...').

- Remove '---' separators when combining templates
- Remove trailing newline from each CRD file before concatenating
- Handle Windows line endings properly
- Update sync instructions to match the correct format
The original crd.yaml file has no trailing newline at the end.
Remove trailing newlines from both files before comparison to ensure
they match exactly.
@bogdanjeler-ev bogdanjeler-ev merged commit d8f61ea into release-psmdb-1.22.0 Jan 14, 2026
2 of 3 checks passed
@bogdanjeler-ev bogdanjeler-ev deleted the K8SPSMDB-1470-for-release-1.22.0 branch January 14, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants