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

ci: etcd using the /livez for LivenessProbe and /readyz for StartupProbe. #5438

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liangyuanpeng
Copy link
Contributor

@liangyuanpeng liangyuanpeng commented Aug 27, 2024

What type of PR is this?

/kind cleanup
etcd using the /livez for LivenessProbe and /readyz for StartupProbe at CI first,
part of #5419
What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Aug 27, 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 xishanyongye-chang 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

@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 27, 2024
@liangyuanpeng
Copy link
Contributor Author

/cc @zhzhuang-zju

@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 30.85%. Comparing base (a184b40) to head (d4ecff3).

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5438      +/-   ##
==========================================
- Coverage   30.85%   30.85%   -0.01%     
==========================================
  Files         640      640              
  Lines       44384    44384              
==========================================
- Hits        13695    13694       -1     
- Misses      29709    29710       +1     
  Partials      980      980              
Flag Coverage Δ
unittests 30.85% <ø> (-0.01%) ⬇️

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 +55 to +56
periodSeconds: 1
timeoutSeconds: 15
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is from kubeadm

@zhzhuang-zju
Copy link
Contributor

/assign

httpGet:
host: 127.0.0.1
path: /readyz
port: 2381
Copy link
Contributor

Choose a reason for hiding this comment

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

The port should be 2379, as our listen-client-urls is set to https://0.0.0.0:2379.

Copy link
Contributor

Choose a reason for hiding this comment

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

    Liveness:     http-get http://127.0.0.1:2381/livez delay=10s timeout=15s period=10s #success=1 #failure=8
    Readiness:    http-get http://127.0.0.1:2381/readyz delay=0s timeout=15s period=1s #success=1 #failure=3
    Startup:      http-get http://127.0.0.1:2381/readyz delay=10s timeout=15s period=10s #success=1 #failure=24

Copy link
Contributor Author

Choose a reason for hiding this comment

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

kubeadm have the arg of --listen-metrics-urls=http://127.0.0.1:2381, so this is 2381, and karmada have not set it.

path: /readyz
port: 2381
scheme: HTTP
periodSeconds: 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Is once per second too frequent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the expected effect of etcd readyz API design, see https://docs.google.com/document/d/1PaUAp76j1X92h3jZF47m32oVlR8Y-p-arB5XOB7Nb6U/edit

path: /livez
port: 2381
scheme: HTTP
initialDelaySeconds: 10
Copy link
Contributor

Choose a reason for hiding this comment

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

The initialDelaySeconds can be set a bit higher.

@zhzhuang-zju
Copy link
Contributor

@liangyuanpeng The livenessProbe should properly reflect the fact that etcd needs a restart. Do you know how /livez accomplishes this? One benefit of using etcdctl get /registry --prefix --keys-only for the liveness check is that if it succeeds, then etcd's external functionality is normal.
In addition, when I used /livez locally, I noticed that kubelet logs the following:

Aug 28 02:48:37 karmada-host-control-plane kubelet[682]: E0828 02:48:37.991001     682 prober.go:239] "Unable to write all bytes from execInContainer" err="short write" expectedBytes=13477 actualBytes=10240

This can cause etcd to restart continuously.

@liangyuanpeng
Copy link
Contributor Author

liangyuanpeng commented Aug 28, 2024

@zhzhuang-zju Thank you for your time! seems like this have some weird problem, let me make it to draft first.

Do you know how /livez accomplishes this

https://docs.google.com/document/d/1PaUAp76j1X92h3jZF47m32oVlR8Y-p-arB5XOB7Nb6U/edit#heading=h.78g8a1kutqd8
And also update it to issue.

@liangyuanpeng liangyuanpeng marked this pull request as draft August 28, 2024 13:46
@karmada-bot karmada-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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