Skip to content
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

[feature request]upgrade NodePool CRD to v1beta2 #2258

Open
rambohe-ch opened this issue Jan 8, 2025 · 2 comments · May be fixed by #2266
Open

[feature request]upgrade NodePool CRD to v1beta2 #2258

rambohe-ch opened this issue Jan 8, 2025 · 2 comments · May be fixed by #2266
Labels
kind/feature kind/feature kind/good-first-issue kind/good-first-issue

Comments

@rambohe-ch
Copy link
Member

What would you like to be added:
According to the following proposal, NodePool CRD will be upgraded to new version: v1beta2.

The new fields should be added to spec and status of NodePool API as following:

// NodePoolSpec defines the desired state of NodePool
type NodePoolSpec struct {
         ...

	// InterConnectivity represents all nodes in the NodePool can access with each other
	// through Layer 2 or Layer 3 network or not. If the field is true,
	// nodepool-level list/watch requests reuse can be applied for this nodepool.
	// otherwise, only node-level list/watch requests reuse can be applied for the nodepool.
	// This field is not supported to change after creation.
	InterConnectivity bool `json:"interConnectivity,omitempty"`

	// LeaderElectionStrategy represents the policy how to elect a leader Yurthub in a nodepool.
	// random: select one ready node as leader at random.
	// mark: select one ready node as leader from nodes that are specified by labelselector.
	// More strategies will be supported according to user's new requirements.
	LeaderElectionStrategy string `json:"leaderElectionStrategy,omitempty"`

	// LeaderNodeLabelSelector is used only when LeaderElectionStrategy is mark. leader Yurhub will be
	// elected from nodes that filtered by this label selector.
	LeaderNodeLabelSelector map[string]string `json:"leaderNodeLabelSelector,omitempty"`

	// PoolScopeMetadata is uesed for specifying resouces which will be shared in the nodepool.
	// And it is supported to modify dynamically. and the default value is v1.Service and discovery.Endpointslice.
	PoolScopeMetadata []metav1.GroupVersionKind `json:"poolScopeMetadata,omitempty"`
}

// NodePoolStatus defines the observed state of NodePool
type NodePoolStatus struct {
         ...

	// LeaderEndpoints is used for storing the address of Leader Yurthub.
	// +optional
	LeaderEndpoints []string `json:"leaderEndpoints,omitempty"`

	// Conditions represents the latest available observations of a NodePool's
	// current state that includes LeaderHubElection status.
	// +optional
	Conditions []NodePoolCondition `json:"conditions,omitempty"`
}

type NodePoolCondition struct {
	// Type of NodePool condition.
	Type NodePoolConditionType `json:"type,omitempty"`
	// Status of the condition, one of True, False, Unknown.
	Status v1.ConditionStatus `json:"status,omitempty"`
	// Last time the condition transitioned from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// The reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`
	// A human readable message indicating details about the transition.
	Message string `json:"message,omitempty"`
}

type NodePoolConditionType string

const (
	// LeaderReady means the status of leader yurthub election.
	// If it's true, a Leader Yurthub is elected, otherwise no leader is elected.
	LeaderHubReady NodePoolConditionType = "LeaderReady"
  )

https://github.com/openyurtio/openyurt/blob/master/docs/proposals/20241211-reuse-nodepool-list-watch-requests.md#api-changes

others
/kind feature

@rambohe-ch rambohe-ch added the kind/feature kind/feature label Jan 8, 2025
@rambohe-ch
Copy link
Member Author

we also need to update nodepool mutate wehbook and get rid of modifying InterConnectivity field.

@rambohe-ch rambohe-ch added the kind/good-first-issue kind/good-first-issue label Jan 8, 2025
@tnsimon
Copy link
Contributor

tnsimon commented Jan 8, 2025

/assign @tnsimon

@tnsimon tnsimon linked a pull request Jan 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature kind/feature kind/good-first-issue kind/good-first-issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants