-
Notifications
You must be signed in to change notification settings - Fork 14
Feature: Add Affinity configuration passthrough #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Can you add this to our docs as well |
|
|
||
| // Affinity/Anti-affinity rules for Pods (cnpg passthrough) | ||
| // +optional | ||
| Affinity cnpgv1.AffinityConfiguration `json:"affinity,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good for now. Affinity is a very k8s specific placement term and we are putting it on the high level. Going forward, we need to group these configs.
Signed-off-by: Alexander Laye <alaye@microsoft.com>
78a4dc6 to
19b66e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for passing through CNPG's affinity configuration to allow users to control pod scheduling for DocumentDB clusters. The implementation exposes CNPG's full AffinityConfiguration type, which includes node affinity, pod affinity, pod anti-affinity, node selectors, tolerations, and topology settings.
Changes:
- Added
Affinityfield toDocumentDBSpecwith CNPG'sAffinityConfigurationtype - Updated CRD definitions to include the complete affinity schema (990+ lines)
- Added documentation section for scheduling configuration
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| operator/src/api/preview/documentdb_types.go | Added Affinity field to DocumentDBSpec with proper kubebuilder tags and comments |
| operator/src/api/preview/zz_generated.deepcopy.go | Added deep copy implementation for the Affinity field |
| operator/src/internal/cnpg/cnpg_cluster.go | Passed through documentdb.Spec.Affinity to CNPG cluster spec |
| operator/src/config/crd/bases/documentdb.io_dbs.yaml | Generated CRD with complete affinity configuration schema |
| operator/documentdb-helm-chart/crds/documentdb.io_dbs.yaml | Generated Helm chart CRD matching the base CRD |
| docs/operator-public-documentation/preview/advanced-configuration/README.md | Added scheduling section with reference to CNPG documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This just adds a passthrough for the already made CNPG node affinity field.