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

Step 2 – controlplane/apiserver: move peer proxy code to allow generic aggregator construction #124576

Merged
merged 1 commit into from Apr 29, 2024

Conversation

sttts
Copy link
Contributor

@sttts sttts commented Apr 27, 2024

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 to c.EndpointReconcilerConfig.Interval as before this PR for kube-apiserver. Hence, the behaviour should be unchanged.

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 27, 2024
@sttts sttts force-pushed the sttts-peer-proxy-generic-move branch from 7527c49 to 4077c3a Compare April 27, 2024 07:22
@k8s-ci-robot k8s-ci-robot added area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 27, 2024
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 27, 2024
@sttts sttts added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Apr 27, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Apr 27, 2024
@sttts sttts changed the title controlplane/apiserver: move peer endpoint reconciler to allow aggregator construction controlplane/apiserver: move peer endpoint reconciler to allow generic aggregator construction Apr 27, 2024
@sttts sttts changed the title controlplane/apiserver: move peer endpoint reconciler to allow generic aggregator construction controlplane/apiserver: move peer proxy code to allow generic aggregator construction Apr 27, 2024
@sttts sttts force-pushed the sttts-peer-proxy-generic-move branch from 4077c3a to 4ad30af Compare April 27, 2024 07:26
@sttts
Copy link
Contributor Author

sttts commented Apr 27, 2024

/retest

@mjudeikis
Copy link
Contributor

/lgtm
/hold
looks sane from stadalone control plane side
waiting for Richa Banker for unhold if happy :)

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 27, 2024
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 27, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 032d48615f43dc58a2d3e8a8d422b2b4111a59e7

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

Incomplete comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@richabanker
Copy link
Contributor

/lgtm
just one nit

…truction

This reverts commit 0bb6ff5e454cfc99c0b611e22162391eaa31e103.

Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
@sttts sttts force-pushed the sttts-peer-proxy-generic-move branch from 4ad30af to c252ebe Compare April 29, 2024 06:13
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 29, 2024
@sttts
Copy link
Contributor Author

sttts commented Apr 29, 2024

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 29, 2024
@mjudeikis
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 29, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e0c3922d84c835d06732a607efdbc54c0212a47f

@sttts
Copy link
Contributor Author

sttts commented Apr 29, 2024

/retest

CertFile: proxyClientCertFile,
KeyFile: proxyClientKeyFile,
CAFile: peerCAFile,
ServerName: "kubernetes.default.svc",
Copy link
Member

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?

Copy link
Contributor Author

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 {
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 kubeapi-specific code or not?

Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor Author

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.

@k8s-ci-robot k8s-ci-robot merged commit c6b6163 into kubernetes:master Apr 29, 2024
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.31 milestone Apr 29, 2024
@cici37
Copy link
Contributor

cici37 commented Apr 30, 2024

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 30, 2024
@sttts sttts changed the title controlplane/apiserver: move peer proxy code to allow generic aggregator construction Step 3 – controlplane/apiserver: move peer proxy code to allow generic aggregator construction May 1, 2024
@sttts sttts changed the title Step 3 – controlplane/apiserver: move peer proxy code to allow generic aggregator construction Step 2 – controlplane/apiserver: move peer proxy code to allow generic aggregator construction May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants