Skip to content

Conversation

shreyashastantram
Copy link
Contributor

@shreyashastantram shreyashastantram commented Sep 30, 2025

Reason for Change:

This PR focuses on extending the mtpnc spec and status fields to include the Pod UID in the spec and the Node name in the status.

Pod UID is added to the spec because controllers are aware of the pod’s unique identifier at the time of mtpnc creation.
Node name is added to the status because scheduling decisions do not depend on the node name parameter. The node name becomes available only after the scheduling decision has been made.
If Node name were part of the spec, it would act as an optional input from the creator of the mtpnc. This could lead to inconsistent states—for example, if the creator specifies a node name that differs from the actual node where the pod is scheduled.

Issue Fixed:

Requirements:

Notes:

// +kubebuilder:validation:Optional
NodeName string `json:"nodeName,omitempty"`
// PodName is the name of the pod
PodName string `json:"podName,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

is this ownerKey ( podname + podnamespace ) or just podname?

Copy link
Member

Choose a reason for hiding this comment

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

I would assume just podName because MTPNC is also created in the same namepace as the pod.

// PodName is the name of the pod
PodName string `json:"podName,omitempty"`
// PodUID is the uid of the pod
PodUID string `json:"podUID,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

curious to know what this would be useful for?

Copy link
Member

Choose a reason for hiding this comment

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

To begin with we want to query MTPNC by podUID, because we have seen some cases where statefulSets create pods with same namd and the second pod sometimes reuses the MTPNC from the first pod. In the future we want name MTPNC based on podUID, so it is unique per pod.

// +kubebuilder:validation:Optional
NodeName string `json:"nodeName,omitempty"`
// PodName is the name of the pod
PodName string `json:"podName,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

I would assume just podName because MTPNC is also created in the same namepace as the pod.

// PodName is the name of the pod
PodName string `json:"podName,omitempty"`
// PodUID is the uid of the pod
PodUID string `json:"podUID,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

To begin with we want to query MTPNC by podUID, because we have seen some cases where statefulSets create pods with same namd and the second pod sometimes reuses the MTPNC from the first pod. In the future we want name MTPNC based on podUID, so it is unique per pod.

@shreyashastantram shreyashastantram marked this pull request as ready for review October 2, 2025 21:33
@shreyashastantram shreyashastantram requested a review from a team as a code owner October 2, 2025 21:33
Copy link
Contributor

@Copilot Copilot AI left a 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 PR extends the MultiTenantPodNetworkConfig (MTPNC) CRD to include additional pod-related fields for better tracking and management. The changes add pod metadata to both the specification and status sections of the CRD.

  • Adds PodUID field to the MTPNC spec for pod identification
  • Adds NodeName field to the MTPNC status for tracking pod placement

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
crd/multitenancy/manifests/multitenancy.acn.azure.com_multitenantpodnetworkconfigs.yaml Updates CRD manifest to include new podUID and nodeName fields
crd/multitenancy/api/v1alpha1/multitenantpodnetworkconfig.go Adds PodUID to spec struct and NodeName to status struct

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

…antpodnetworkconfigs.yaml

Co-authored-by: Copilot <[email protected]>
Signed-off-by: shreyashastantram <[email protected]>
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