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

Agent drain: implement agent side. (Remaining: server) #584

Merged
merged 2 commits into from
May 29, 2024

Conversation

jkh52
Copy link
Contributor

@jkh52 jkh52 commented Mar 12, 2024

Agent drain: first half of #566

  • Agent sends drain signal to Server.
  • Server only logs it.
  • Test cases.

Note that if a new agent binary sends the DRAIN message to an old server binary, it is harmless and will be ignored:

klog.V(5).InfoS("Ignoring unrecognized packet from backend", "packet", pkt, "agentID", agentID)

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 12, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jkh52

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 12, 2024
- make gen-proto
- go mod vendor
@jkh52 jkh52 force-pushed the agent-drain branch 2 times, most recently from fa6e769 to ed021e1 Compare March 19, 2024 22:58
@jkh52 jkh52 force-pushed the agent-drain branch 2 times, most recently from 66b0215 to 62a94a0 Compare March 20, 2024 18:07
- Agent sends drain signal to Server.
- Server only logs it.
@jkh52 jkh52 marked this pull request as ready for review March 20, 2024 18:48
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 20, 2024
s := <-signalCh
klog.V(2).InfoS("Received first signal", "signal", s)
close(drainCh)
s = <-signalCh
Copy link
Contributor

Choose a reason for hiding this comment

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

Once we begin draining, do we want to timeout and stop if no second signal is sent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the most cautious (and simple) decision is no, keep an agent in this state fully functioning.

@cheftako
Copy link
Contributor

To be clear this is doing nothing to actually "drain"? Its just a prep step for that later PR?

@jkh52
Copy link
Contributor Author

jkh52 commented Mar 21, 2024

To be clear this is doing nothing to actually "drain"? Its just a prep step for that later PR?

Right, this PR should be a functional no-op for the agent, except for sending the draining hint to the server (for later PR: agent selection).

@jkh52
Copy link
Contributor Author

jkh52 commented Mar 22, 2024

/assign @cheftako
/assign @tallclair

@jkh52 jkh52 changed the title Agent drain: implement first half. Agent drain: implement agent side. (Remaining: server) Mar 26, 2024
@cheftako
Copy link
Contributor

/lgtm
Looking forward to the actual drain logic being added. We clearly need to discuss edge cases such as what to do when ALL agents are in the drain state.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 29, 2024
@k8s-ci-robot k8s-ci-robot merged commit 94bd4ac into kubernetes-sigs:master May 29, 2024
16 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants