interface: add status object for managed namespace placement#1164
interface: add status object for managed namespace placement#1164britaniar wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new status object for managed namespace placement functionality by adding a ManagedNamespacePlacement custom resource. The purpose is to track which clusters a namespace has been placed on, providing visibility into namespace placement status across the fleet.
Key changes include:
- Addition of a new
ManagedNamespacePlacementCRD with status tracking capabilities - Registration of the new type in the scheme builder
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| config/crd/bases/placement.kubernetes-fleet.io_managednamespaceplacements.yaml | Adds complete CRD definition for ManagedNamespacePlacement with comprehensive status object structure |
| apis/placement/v1beta1/clusterresourceplacement_types.go | Defines the Go struct for ManagedNamespacePlacement and registers it in the scheme |
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| // ManagedNamespacePlacement is used to represent which clusters the namespace has been placed on to. | ||
| type ManagedNamespacePlacement struct { |
There was a problem hiding this comment.
Why do you use managednamespace as a prefix? Should this object exist for namespaces placed by a CRP?
| type ManagedNamespacePlacementStatus struct { | ||
| // ResourcePlacements contains the placement statuses for the namespace. | ||
| // +kubebuilder:validation:Optional | ||
| ResourcePlacements []ResourcePlacementStatus `json:"resourcePlacements,omitempty"` |
There was a problem hiding this comment.
What does the status represent? Only the status of the namespace or namespace+resources as selected by the CRP?
There was a problem hiding this comment.
I assume this is a copy of the ResourcePlacementStatus list from CRP. If so, I would recommend to copy the whole status as SelectedResources and ObservedResourceIndex are also critical information to understand the conditions.
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| // ManagedNamespacePlacement is used to represent which clusters the namespace has been placed on to. | ||
| type ManagedNamespacePlacement struct { |
There was a problem hiding this comment.
How do you know which CRP this status is for? Can one namespace selected/placed by N CRPs?
There was a problem hiding this comment.
If this object won't exist when there are N CRPs, provide a comment.
|
close this as we should move this to kubefleet. Will address comments there |
Description of your changes
Fixes #
I have: created an object that CRP should add to the namespace that the user can access so they can determine which clusters the namespace has been placed on to.
make reviewableto ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer