-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
This adds an etcd health check endpoint to kube-apiserver #49412
This adds an etcd health check endpoint to kube-apiserver #49412
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Hi @bjhaid. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/assign @deads2k |
@@ -20,6 +20,9 @@ import ( | |||
"fmt" | |||
|
|||
"github.com/spf13/pflag" | |||
"net/http" | |||
"k8s.io/apiserver/pkg/server/healthz" | |||
"k8s.io/kubernetes/cmd/kube-apiserver/app/preflight" |
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.
This dependency won't be allowed. You'll need to move the etcd check code to the k8s.io/apiserver
staging section somewhere.
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 the reverse allowed, that is adding a k8s.io/apiserver/...
dependency to k8s.io/kubernetes/cmd/kube-apiserver/app/preflight
? So I don't end up duplicating code
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 the reverse allowed, that is adding a k8s.io/apiserver/... dependency to k8s.io/kubernetes/cmd/kube-apiserver/app/preflight
yes the reverse is allowed
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.
Can I just move preflight
and it's test in to staging and fix the references?
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.
Can I just move preflight and it's test in to staging and fix the references?
Yes. This seems more like apiserver/pkg/storage/etcd3/healthz
@k8s-bot ok to test |
This is looking good. |
89ee978
to
9e62dc9
Compare
looks like something is going wrong. |
I spoke to folks in #sig-testing and they told me to run |
9e62dc9
to
9f77bb5
Compare
0630735
to
bbed16e
Compare
/test pull-kubernetes-bazel |
2 similar comments
/test pull-kubernetes-bazel |
/test pull-kubernetes-bazel |
/test Submit Queue |
@deads2k needs a lgtm.. |
@@ -20,6 +20,9 @@ import ( | |||
"fmt" | |||
|
|||
"github.com/spf13/pflag" | |||
"k8s.io/apiserver/pkg/server/healthz" | |||
"k8s.io/apiserver/pkg/storage/etcd3/preflight" | |||
"net/http" |
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.
nit: this goes in first section of imports since its a stdlib
@@ -20,6 +20,9 @@ import ( | |||
"fmt" | |||
|
|||
"github.com/spf13/pflag" | |||
"k8s.io/apiserver/pkg/server/healthz" |
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.
nit: want an empty line before these. we normally put a gap between dependencies and in-project deps
bbed16e
to
419f60a
Compare
/lgtm |
419f60a
to
47d748c
Compare
/test pull-kubernetes-unit |
/test pull-kubernetes-verify |
/test pull-kubernetes-e2e-kops-aws |
/test pull-kubernetes-e2e-gce-etcd3 |
@bjhaid: you can't request testing unless you are a kubernetes member. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@bjhaid: you can't request testing unless you are a kubernetes member. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test pull-kubernetes-e2e-kops-aws |
@bjhaid: you can't request testing unless you are a kubernetes member. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bjhaid, deads2k Associated issue: 48215 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 49989, 49806, 49649, 49412, 49512) |
addressing #48215.
What this PR does / why we need it:
This ensures kube-apiserver
/healthz
endpoint fails whenever connectivity cannot be established to etcd, also ensures the etcd preflight checks works with unix socketsWhich issue this PR fixes: fixes #48215
Special notes for your reviewer:
This PR does not use the etcd client directly as the client object is wrapped behind the storage interface and not exposed directly for use, so I decided to reuse what's being done in the preflight. So this will only check fail for connectivity and not etcd auth related problems. I did not write tests for the endpoint because I couldn't find examples that I could follow for writing tests for healthz related endpoints, I'll be willing to write those tests if someone can point me at a relevant one.
Release note:
@deads2k please help review, thanks!