-
Notifications
You must be signed in to change notification settings - Fork 876
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
jabellard
wants to merge
2
commits into
karmada-io:master
Choose a base branch
from
jabellard:api_server_service_info
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
docs/proposals/karmada-operator/api-server-service-status/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
title: Add API Server Service Information to `KarmadaStatus` | ||
authors: | ||
- "@jabellard" | ||
reviewers: | ||
- "@RainbowMango" | ||
approvers: | ||
- "@RainbowMango" | ||
|
||
creation-date: 2024-09-24 | ||
|
||
--- | ||
|
||
# Add API Server Service Information to `KarmadaStatus` | ||
|
||
## Summary | ||
|
||
This proposal aims to enhance `KarmadaStatus` by adding a new field that contains the name and port of the API server service for a Karmada control plane. This change will simplify the process of referencing an API server service, | ||
eliminating the need to infer the service name and exposed client port. This is useful for higher-level operators that may need to perform additional tasks like creating an ingress resource to configure external traffic to the service once a Karmada instance has been provisioned. | ||
|
||
## Motivation | ||
|
||
When managing a Karmada instance, referencing its API server service (e.g., for creating an ingress resource) currently requires inferring the service name and exposed port from conventions. Relying on this method is brittle since it depends on internal implementation details that may change. | ||
|
||
By including the API server service information directly in the `KarmadaStatus` field, operators can directly reference the service name and exposed port, improving reliability and simplifying cluster management. | ||
|
||
### Goals | ||
|
||
- Add a new field to `KarmadaStatus` to store the API server service information. | ||
- Ensure the API server service information is accessible to operators or higher-level systems. | ||
|
||
### Non-Goals | ||
|
||
- Modify the process of how the Karmada API server service is created. | ||
- Affect backward compatibility of the existing `KarmadaStatus`. | ||
|
||
## Proposal | ||
|
||
The proposal is to introduce a new field, `APIServerServiceStatus`, in `KarmadaStatus` to capture the name and port of the Karmada API server service. This would provide a more reliable method for referencing the service when creating additional resources, like `Ingress` objects. | ||
|
||
|
||
### User Stories | ||
|
||
#### Story 1 | ||
As an operator, I want to provision an Ingress for the Karmada API server without needing to guess or infer the service name and port. | ||
|
||
#### Story 2 | ||
As an administrator, I want to ensure the control plane's API server service is reliably discoverable by systems provisioning resources on top of Karmada. | ||
|
||
### Risks and Mitigations | ||
|
||
This change introduces minimal risk as it is backward-compatible. The new field will be optional, and systems that do not need it can safely ignore it. | ||
Testing should focus on ensuring that the Karmada operator correctly populates the new field in `KarmadaStatus`. | ||
|
||
## Design Details | ||
With the proposed changes, `KarmadaStatus` will have the following structure: | ||
|
||
```go | ||
// 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"` | ||
} | ||
``` | ||
The Karmada operator will need to be updated to populate the `APIServerServiceStatus` field during its reconciliation process. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
, andExternalName
.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.
There was a problem hiding this comment.
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
, andLoadBalancer
service types. I don't see support for service typeExternalName
, 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.ClusterIP
: the portNodePort
: the port and node portLoadBalancer
: the port, node port, and load balancer statusAs such, the status struct will look something like this:
Anything I may have missed? Would love to hear your thoughts?