-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Implement PriorityClass Support #8883
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
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8883 +/- ##
==========================================
+ Coverage 59.30% 59.72% +0.42%
==========================================
Files 380 381 +1
Lines 43784 43889 +105
==========================================
+ Hits 25965 26213 +248
+ Misses 16280 16130 -150
- Partials 1539 1546 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
29af40a to
2f72032
Compare
303ad7e to
5c9c01a
Compare
373fe4a to
9727a9e
Compare
42ec9d1 to
a67f679
Compare
|
@kaovilai |
- Add ValidatePriorityClassWithClient function to validate priority class existence - Integrate validation in maintenance.go when creating maintenance jobs - Update tests to cover the new validation functionality - Return boolean from ValidatePriorityClass to allow fallback behavior This ensures maintenance jobs don't fail due to non-existent priority classes, following the same pattern used for data mover pods. Addresses feedback from: vmware-tanzu#8883 (comment) Refs vmware-tanzu#8869 Signed-off-by: Tiger Kaovilai <[email protected]>
- Add --server-priority-class-name and --node-agent-priority-class-name flags to velero install command - Configure data mover pods (PVB/PVR/DataUpload/DataDownload) to use priority class from node-agent-configmap - Configure maintenance jobs to use priority class from repo-maintenance-job-configmap (global config only) - Add priority class validation with ValidatePriorityClass and GetDataMoverPriorityClassName utilities - Update e2e tests to include PriorityClass testing utilities - Move priority class design document to Implemented folder - Add comprehensive unit tests for all priority class implementations - Update documentation for priority class configuration - Add changelog entry for vmware-tanzu#8883 Signed-off-by: Tiger Kaovilai <[email protected]> remove unused test utils Signed-off-by: Tiger Kaovilai <[email protected]> feat: add unit test for getting priority class name in maintenance jobs Signed-off-by: Tiger Kaovilai <[email protected]> doc update Signed-off-by: Tiger Kaovilai <[email protected]> feat: add priority class validation for repository maintenance jobs - Add ValidatePriorityClassWithClient function to validate priority class existence - Integrate validation in maintenance.go when creating maintenance jobs - Update tests to cover the new validation functionality - Return boolean from ValidatePriorityClass to allow fallback behavior This ensures maintenance jobs don't fail due to non-existent priority classes, following the same pattern used for data mover pods. Addresses feedback from: vmware-tanzu#8883 (comment) Refs vmware-tanzu#8869 Signed-off-by: Tiger Kaovilai <[email protected]> refactor: clean up priority class handling for data mover pods - Fix comment in node_agent.go to clarify PriorityClassName is only for data mover pods - Simplify server.go to use dataPathConfigs.PriorityClassName directly - Remove redundant priority class logging from controllers as it's already logged during server startup - Keep logging centralized in the node-agent server initialization This reduces code duplication and clarifies the scope of priority class configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Tiger Kaovilai <[email protected]> refactor: remove GetDataMoverPriorityClassName from kube utilities Remove GetDataMoverPriorityClassName function and its tests as priority class is now read directly from dataPathConfigs instead of parsing from ConfigMap. This simplifies the codebase by eliminating the need for indirect ConfigMap parsing. Refs vmware-tanzu#8869 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Tiger Kaovilai <[email protected]> refactor: remove priority class validation from install command Remove priority class validation during install as it's redundant since validation already occurs during server startup. Users cannot see console logs during install, making the validation warnings ineffective at this stage. The validation remains in place during server and node-agent startup where it's more appropriate and visible to users. Signed-off-by: Tiger Kaovilai <[email protected]> Co-Authored-By: Claude <[email protected]>
- Add --server-priority-class-name and --node-agent-priority-class-name flags to velero install command - Configure data mover pods (PVB/PVR/DataUpload/DataDownload) to use priority class from node-agent-configmap - Configure maintenance jobs to use priority class from repo-maintenance-job-configmap (global config only) - Add priority class validation with ValidatePriorityClass and GetDataMoverPriorityClassName utilities - Update e2e tests to include PriorityClass testing utilities - Move priority class design document to Implemented folder - Add comprehensive unit tests for all priority class implementations - Update documentation for priority class configuration - Add changelog entry for vmware-tanzu#8883 Signed-off-by: Tiger Kaovilai <[email protected]> remove unused test utils Signed-off-by: Tiger Kaovilai <[email protected]> feat: add unit test for getting priority class name in maintenance jobs Signed-off-by: Tiger Kaovilai <[email protected]> doc update Signed-off-by: Tiger Kaovilai <[email protected]> feat: add priority class validation for repository maintenance jobs - Add ValidatePriorityClassWithClient function to validate priority class existence - Integrate validation in maintenance.go when creating maintenance jobs - Update tests to cover the new validation functionality - Return boolean from ValidatePriorityClass to allow fallback behavior This ensures maintenance jobs don't fail due to non-existent priority classes, following the same pattern used for data mover pods. Addresses feedback from: vmware-tanzu#8883 (comment) Refs vmware-tanzu#8869 Signed-off-by: Tiger Kaovilai <[email protected]> refactor: clean up priority class handling for data mover pods - Fix comment in node_agent.go to clarify PriorityClassName is only for data mover pods - Simplify server.go to use dataPathConfigs.PriorityClassName directly - Remove redundant priority class logging from controllers as it's already logged during server startup - Keep logging centralized in the node-agent server initialization This reduces code duplication and clarifies the scope of priority class configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Tiger Kaovilai <[email protected]> refactor: remove GetDataMoverPriorityClassName from kube utilities Remove GetDataMoverPriorityClassName function and its tests as priority class is now read directly from dataPathConfigs instead of parsing from ConfigMap. This simplifies the codebase by eliminating the need for indirect ConfigMap parsing. Refs vmware-tanzu#8869 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Tiger Kaovilai <[email protected]> refactor: remove priority class validation from install command Remove priority class validation during install as it's redundant since validation already occurs during server startup. Users cannot see console logs during install, making the validation warnings ineffective at this stage. The validation remains in place during server and node-agent startup where it's more appropriate and visible to users. Signed-off-by: Tiger Kaovilai <[email protected]> Co-Authored-By: Claude <[email protected]>
- Add --server-priority-class-name and --node-agent-priority-class-name flags to velero install command - Configure data mover pods (PVB/PVR/DataUpload/DataDownload) to use priority class from node-agent-configmap - Configure maintenance jobs to use priority class from repo-maintenance-job-configmap (global config only) - Add priority class validation with ValidatePriorityClass and GetDataMoverPriorityClassName utilities - Update e2e tests to include PriorityClass testing utilities - Move priority class design document to Implemented folder - Add comprehensive unit tests for all priority class implementations - Update documentation for priority class configuration - Add changelog entry for vmware-tanzu#8883 Signed-off-by: Tiger Kaovilai <[email protected]> remove unused test utils Signed-off-by: Tiger Kaovilai <[email protected]> feat: add unit test for getting priority class name in maintenance jobs Signed-off-by: Tiger Kaovilai <[email protected]> doc update Signed-off-by: Tiger Kaovilai <[email protected]> feat: add priority class validation for repository maintenance jobs - Add ValidatePriorityClassWithClient function to validate priority class existence - Integrate validation in maintenance.go when creating maintenance jobs - Update tests to cover the new validation functionality - Return boolean from ValidatePriorityClass to allow fallback behavior This ensures maintenance jobs don't fail due to non-existent priority classes, following the same pattern used for data mover pods. Addresses feedback from: vmware-tanzu#8883 (comment) Refs vmware-tanzu#8869 Signed-off-by: Tiger Kaovilai <[email protected]> refactor: clean up priority class handling for data mover pods - Fix comment in node_agent.go to clarify PriorityClassName is only for data mover pods - Simplify server.go to use dataPathConfigs.PriorityClassName directly - Remove redundant priority class logging from controllers as it's already logged during server startup - Keep logging centralized in the node-agent server initialization This reduces code duplication and clarifies the scope of priority class configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Tiger Kaovilai <[email protected]> refactor: remove GetDataMoverPriorityClassName from kube utilities Remove GetDataMoverPriorityClassName function and its tests as priority class is now read directly from dataPathConfigs instead of parsing from ConfigMap. This simplifies the codebase by eliminating the need for indirect ConfigMap parsing. Refs vmware-tanzu#8869 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Tiger Kaovilai <[email protected]> refactor: remove priority class validation from install command Remove priority class validation during install as it's redundant since validation already occurs during server startup. Users cannot see console logs during install, making the validation warnings ineffective at this stage. The validation remains in place during server and node-agent startup where it's more appropriate and visible to users. Signed-off-by: Tiger Kaovilai <[email protected]> Co-Authored-By: Claude <[email protected]>
|
@kaovilai Please resolve the conflicts. |
|
rebasing |
- Add --server-priority-class-name and --node-agent-priority-class-name flags to velero install command - Configure data mover pods (PVB/PVR/DataUpload/DataDownload) to use priority class from node-agent-configmap - Configure maintenance jobs to use priority class from repo-maintenance-job-configmap (global config only) - Add priority class validation with ValidatePriorityClass and GetDataMoverPriorityClassName utilities - Update e2e tests to include PriorityClass testing utilities - Move priority class design document to Implemented folder - Add comprehensive unit tests for all priority class implementations - Update documentation for priority class configuration - Add changelog entry for vmware-tanzu#8883 Signed-off-by: Tiger Kaovilai <[email protected]> remove unused test utils Signed-off-by: Tiger Kaovilai <[email protected]> feat: add unit test for getting priority class name in maintenance jobs Signed-off-by: Tiger Kaovilai <[email protected]> doc update Signed-off-by: Tiger Kaovilai <[email protected]> feat: add priority class validation for repository maintenance jobs - Add ValidatePriorityClassWithClient function to validate priority class existence - Integrate validation in maintenance.go when creating maintenance jobs - Update tests to cover the new validation functionality - Return boolean from ValidatePriorityClass to allow fallback behavior This ensures maintenance jobs don't fail due to non-existent priority classes, following the same pattern used for data mover pods. Addresses feedback from: vmware-tanzu#8883 (comment) Refs vmware-tanzu#8869 Signed-off-by: Tiger Kaovilai <[email protected]> refactor: clean up priority class handling for data mover pods - Fix comment in node_agent.go to clarify PriorityClassName is only for data mover pods - Simplify server.go to use dataPathConfigs.PriorityClassName directly - Remove redundant priority class logging from controllers as it's already logged during server startup - Keep logging centralized in the node-agent server initialization This reduces code duplication and clarifies the scope of priority class configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Tiger Kaovilai <[email protected]> refactor: remove GetDataMoverPriorityClassName from kube utilities Remove GetDataMoverPriorityClassName function and its tests as priority class is now read directly from dataPathConfigs instead of parsing from ConfigMap. This simplifies the codebase by eliminating the need for indirect ConfigMap parsing. Refs vmware-tanzu#8869 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Tiger Kaovilai <[email protected]> refactor: remove priority class validation from install command Remove priority class validation during install as it's redundant since validation already occurs during server startup. Users cannot see console logs during install, making the validation warnings ineffective at this stage. The validation remains in place during server and node-agent startup where it's more appropriate and visible to users. Signed-off-by: Tiger Kaovilai <[email protected]> Co-Authored-By: Claude <[email protected]>
|
@kaovilai |
|
yes |
- Add --server-priority-class-name and --node-agent-priority-class-name flags to velero install command - Configure data mover pods (PVB/PVR/DataUpload/DataDownload) to use priority class from node-agent-configmap - Configure maintenance jobs to use priority class from repo-maintenance-job-configmap (global config only) - Add priority class validation with ValidatePriorityClass and GetDataMoverPriorityClassName utilities - Update e2e tests to include PriorityClass testing utilities - Move priority class design document to Implemented folder - Add comprehensive unit tests for all priority class implementations - Update documentation for priority class configuration - Add changelog entry for vmware-tanzu#8883 Signed-off-by: Tiger Kaovilai <[email protected]> remove unused test utils Signed-off-by: Tiger Kaovilai <[email protected]> feat: add unit test for getting priority class name in maintenance jobs Signed-off-by: Tiger Kaovilai <[email protected]> doc update Signed-off-by: Tiger Kaovilai <[email protected]> feat: add priority class validation for repository maintenance jobs - Add ValidatePriorityClassWithClient function to validate priority class existence - Integrate validation in maintenance.go when creating maintenance jobs - Update tests to cover the new validation functionality - Return boolean from ValidatePriorityClass to allow fallback behavior This ensures maintenance jobs don't fail due to non-existent priority classes, following the same pattern used for data mover pods. Addresses feedback from: vmware-tanzu#8883 (comment) Refs vmware-tanzu#8869 Signed-off-by: Tiger Kaovilai <[email protected]> refactor: clean up priority class handling for data mover pods - Fix comment in node_agent.go to clarify PriorityClassName is only for data mover pods - Simplify server.go to use dataPathConfigs.PriorityClassName directly - Remove redundant priority class logging from controllers as it's already logged during server startup - Keep logging centralized in the node-agent server initialization This reduces code duplication and clarifies the scope of priority class configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Tiger Kaovilai <[email protected]> refactor: remove GetDataMoverPriorityClassName from kube utilities Remove GetDataMoverPriorityClassName function and its tests as priority class is now read directly from dataPathConfigs instead of parsing from ConfigMap. This simplifies the codebase by eliminating the need for indirect ConfigMap parsing. Refs vmware-tanzu#8869 🤖 Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Tiger Kaovilai <[email protected]> refactor: remove priority class validation from install command Remove priority class validation during install as it's redundant since validation already occurs during server startup. Users cannot see console logs during install, making the validation warnings ineffective at this stage. The validation remains in place during server and node-agent startup where it's more appropriate and visible to users. Signed-off-by: Tiger Kaovilai <[email protected]> Co-Authored-By: Claude <[email protected]>
Add priority class support for Velero components
Summary
This PR implements priority class support for Velero components, allowing users to configure Kubernetes priority classes for the Velero server, node-agent, data mover pods, and maintenance jobs. This ensures proper pod scheduling and preemption behavior in resource-constrained environments.
Changes
Core Implementation
--server-priority-class-nameand--node-agent-priority-class-nameflags tovelero installcommandKey Features
ValidatePriorityClassnow returns a boolean, allowing callers to handle missing priority classes gracefullyConfiguration Flow
graph TB subgraph "Installation Time" CLI[velero install] --> |"--server-priority-class-name"| Server[Velero Server Deployment] CLI --> |"--node-agent-priority-class-name"| NodeAgent[Node Agent DaemonSet] end subgraph "ConfigMap Configuration" NAConfig[node-agent-configmap] --> |priorityClassName| DataMovers[Data Mover Pods] MJConfig[repo-maintenance-job-configmap] --> |global.priorityClassName| MaintJobs[Maintenance Jobs] end subgraph "Runtime Flow" NodeAgentServer[Node Agent Server Startup] --> |Read Once| NAConfig NodeAgentServer --> |Validate| ValidatePC{Priority Class Exists?} ValidatePC -->|Yes| PassToControllers[Pass to Controllers] ValidatePC -->|No| ClearPC[Clear Priority Class<br/>Log Warning] ClearPC --> PassToControllers PassToControllers --> PVBController[PVB Controller] PassToControllers --> PVRController[PVR Controller] PassToControllers --> DUController[DataUpload Controller] PassToControllers --> DDController[DataDownload Controller] PVBController --> PVBPods[PVB Pods] PVRController --> PVRPods[PVR Pods] DUController --> DUPods[DataUpload Pods] DDController --> DDPods[DataDownload Pods] end subgraph "Maintenance Jobs" MaintController[Maintenance Controller] --> |Read Fresh| MJConfig MaintController --> MaintJobs end style ValidatePC fill:#f9f,stroke:#333,stroke-width:2px style ClearPC fill:#ff9,stroke:#333,stroke-width:2pxPriority Class Hierarchy
Example Usage
Testing
ValidatePriorityClassandGetDataMoverPriorityClassNameDocumentation
design/Implemented/priority-class-name-support_design.mdFixes #8869
Checklist