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

Proposal: Add API Server Service Information to KarmadaStatus #5599

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jabellard
Copy link
Contributor

What type of PR is this?

/kind design

What this PR does / why we need it:

  • Details are contained in the proposal.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Joe Nathan Abellard <[email protected]>
@karmada-bot karmada-bot added the kind/design Categorizes issue or PR as related to design. label Sep 24, 2024
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rainbowmango for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Joe Nathan Abellard <[email protected]>
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 24, 2024
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.82%. Comparing base (5f7fc4f) to head (665c65b).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5599      +/-   ##
==========================================
- Coverage   34.84%   34.82%   -0.03%     
==========================================
  Files         645      645              
  Lines       44861    44861              
==========================================
- Hits        15633    15624       -9     
- Misses      28021    28028       +7     
- Partials     1207     1209       +2     
Flag Coverage Δ
unittests 34.82% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Comment on lines +59 to +75
// KarmadaStatus defines the most recently observed status of the Karmada.
type KarmadaStatus struct {
// Other existing fields...

// APIServerServiceStatus contains the current status of the Karmada API server service.
// +optional
APIServerServiceStatus APIServerServiceStatus `json:"apiServerServiceStatus,omitempty"`
}

// APIServerServiceStatus contains the current status of the API server service.
type APIServerServiceStatus struct {
// Name represents the name of the service.
Name string `json:"name"`

// Port represents the client port exposed by the service.
Port int32 `json:"port"`
}
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 structure suitable for all kinds of Services?
As you know, karmada-operator allows users to specify Karmada APIServer ServiceType which including ClusterIP, NodePort, LoadBalancer, and ExternalName.

I'm not sure if all of these service approaches have been implemented or work as expected.
But I think it's a great chance to revisit the design about how to expose Karmada APIServer Service.

Any thoughts?
Also, cc @chaunceyjiang who might interested in this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@RainbowMango , you bring up a great point. As far as I can tell by looking at the code, there's only support for ClusterIP, NodePort, and LoadBalancer service types. I don't see support for service type ExternalName, which I expected as I don't think that would make sense for the API server. In addition to the service name and its type, let me break down what I think will be required for each type.

  1. ClusterIP: the port
  2. NodePort: the port and node port
  3. LoadBalancer: the port, node port, and load balancer status

As such, the status struct will look something like this:

type APIServerServiceStatus struct {
	// Name represents the name of the service.
	Name string `json:"name"`

	// ServiceType represents the service type
	ServiceType corev1.ServiceType `json:"serviceType"`

	// Port represents the port exposed by the service.
	Port int32 `json:"port"`

	// NodePort represents the node port on which the service is exposed
	// when service is of type NodePort or LoadBalancer
	// +optional
	NodePort int32 `json:"nodePort"`

	// LoadBalancerStatus represents the status of a load-balancer when
	// the service is of type LoadBalancer
	// +optional
	LoadBalancerStatus corev1.LoadBalancerStatus `json:"loadBalancerStatus"`
}

Anything I may have missed? Would love to hear your thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/design Categorizes issue or PR as related to design. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants