Skip to content

Conversation

hieunhums
Copy link
Contributor

@hieunhums hieunhums commented Jul 23, 2025

This pull request introduces support for managing Kubernetes ClusterResourcePlacement (CRP) operations within Azure Kubernetes Service (AKS) Fleet management tools. It includes updates to documentation, command-line tools, and backend logic to enable CRP operations such as create, list, show, and delete. The changes also enhance the Fleet Executor to handle Kubernetes-specific operations and improve usability by adding new commands like get-credentials for fleets.

Demo: https://claude.ai/share/51ac03ff-5c3b-4f4b-bb53-c00c91cb1011

Documentation Updates:

  • Updated README.md to include Azure Fleet operations and CRP-related examples, such as creating placements and listing fleet members. [1] [2]
  • Documented CRP operations and the get-credentials command in prompts/azure-fleet-tools.md. [1] [2] [3]

Command-Line Tool Enhancements:

  • Added CRP operations (list, show, get, create, delete) and the get-credentials command to the Fleet tool registry (internal/components/fleet/registry.go).
  • Updated command validation and access level checks to support new operations. [1] [2]

Backend Logic:

  • Extended FleetExecutor to route CRP operations to Kubernetes APIs, initialize Kubernetes clients, and handle CRP-specific logic. [1] [2]
  • Introduced new Kubernetes client and placement operations classes to execute CRP commands via kubectl. [1] [2]

Codebase Improvements:

  • Added helper methods for CRP operations, including argument parsing, manifest creation, and policy validation. [1] [2]

These changes collectively enable seamless integration of Kubernetes CRP management into the existing Azure Fleet tools, providing users with enhanced capabilities for multi-cluster scenarios.

… documentation

- Added support for Kubernetes ClusterResourcePlacement operations in the fleet command executor.
- Updated README to reflect new capabilities, including managing Azure Fleet and Kubernetes resources.
- Enhanced command descriptions and examples for clarity.
- Introduced new commands for placement management: create, list, show, and delete.
- Improved error handling and validation for placement operations.
…s placement operations

- Removed unnecessary stdout logging during panic recovery to reduce pollution.
- Introduced a new `cleanResult` function to sanitize results for MCP compatibility.
- Streamlined the creation of resource selectors in the `CreatePlacement` method.
- Updated `GetPlacement` and `ListPlacements` methods to return results in JSON format for better integration.
@codecov-commenter
Copy link

codecov-commenter commented Jul 23, 2025

Codecov Report

Attention: Patch coverage is 55.32787% with 109 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@0ac980c). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/azcli/fleet_executor.go 46.09% 71 Missing and 5 partials ⚠️
internal/components/fleet/kubernetes/placement.go 68.49% 19 Missing and 4 partials ⚠️
internal/components/fleet/kubernetes/client.go 52.38% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #91   +/-   ##
=======================================
  Coverage        ?   30.78%           
=======================================
  Files           ?       47           
  Lines           ?     4194           
  Branches        ?        0           
=======================================
  Hits            ?     1291           
  Misses          ?     2875           
  Partials        ?       28           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…erations and improve error messages

- Changed parameter type in test cases from `map[string]interface{}` to `map[string]any`.
- Updated error messages to specify when placement operations are not initialized.
- Ensured all relevant tests reflect the new error handling for uninitialized operations.
Copy link
Member

@gossion gossion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gossion gossion merged commit de9bb5f into Azure:main Jul 24, 2025
9 checks passed
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.

3 participants