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
Step 2 – controlplane/apiserver: move peer proxy code to allow generic aggregator construction #124576
Step 2 – controlplane/apiserver: move peer proxy code to allow generic aggregator construction #124576
Conversation
7527c49
to
4077c3a
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
4077c3a
to
4ad30af
Compare
/retest |
/lgtm |
LGTM label has been added. Git tree hash: 032d48615f43dc58a2d3e8a8d422b2b4111a59e7
|
pkg/controlplane/instance.go
Outdated
@@ -290,6 +275,11 @@ func (c *Config) createEndpointReconciler() reconcilers.EndpointReconciler { | |||
|
|||
// Complete fills in any fields not set that are required to have valid data. It's mutating the receiver. | |||
func (c *Config) Complete() CompletedConfig { | |||
if c.ControlPlane.PeerEndpointReconcileInterval == 0 && c.EndpointReconcilerConfig.Interval != 0 { | |||
// default before the generic controlplane completion can |
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.
Incomplete comment?
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.
fixed
/lgtm |
…truction This reverts commit 0bb6ff5e454cfc99c0b611e22162391eaa31e103. Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
4ad30af
to
c252ebe
Compare
/hold cancel |
/lgtm |
LGTM label has been added. Git tree hash: e0c3922d84c835d06732a607efdbc54c0212a47f
|
/retest |
CertFile: proxyClientCertFile, | ||
KeyFile: proxyClientKeyFile, | ||
CAFile: peerCAFile, | ||
ServerName: "kubernetes.default.svc", |
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.
should this leak into generic or be an option?
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.
An option in follow-up (step 3).
serializer, | ||
), nil | ||
} | ||
|
||
// utility function to get the apiserver address that is used by peer apiservers to proxy | ||
// requests to this apiserver in case the peer is incapable of serving the request | ||
func getPeerAddress(peerAdvertiseAddress peerreconcilers.PeerAdvertiseAddress, publicAddress net.IP, publicServicePort int) string { |
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 kubeapi-specific code or not?
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.
Generic. It will be moved in #120202.
// that can not be served locally | ||
PeerProxy utilpeerproxy.Interface | ||
// PeerEndpointReconcileInterval defines how often the endpoint leases are reconciled in etcd. | ||
PeerEndpointReconcileInterval time.Duration |
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.
where is this used, if anywhere? it seems net new?
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.
It's defaulted in the generic code, and overridden with the service endpoint reconciler interval (= old behaviour) for kube-apiserver.
/triage accepted |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Move peer proxy config flags and constructors to
pkg/controlplane/apiserver
to make it consumable by a generic controlplane.Part of #124530.
Note that this reverts some moves from #124551 intentionally (!), to make this changed logic easy to review.
Which issue(s) this PR fixes:
Towards kubernetes/enhancements#4080.
Fixes #
Special notes for your reviewer:
This is purely a code move with exception of defaulting the peer pendpoint reconciler interval
DefaultPeerEndpointReconcileInterval
in the generic code path, but setting it toc.EndpointReconcilerConfig.Interval
as before this PR for kube-apiserver. Hence, the behaviour should be unchanged.Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: