-
Notifications
You must be signed in to change notification settings - Fork 655
optionally read node and port information from env variables for kube* services #733
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
optionally read node and port information from env variables for kube* services #733
Conversation
Welcome @raghu-nandan-bs! |
Hi @raghu-nandan-bs. 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 Once the patch is verified, the new status will be reflected by the 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. |
/hold |
/hold cancel |
/ok-to-test |
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.
Left a couple of comments. One more ask: could you add some unit tests for this new logic in https://github.com/kubernetes/node-problem-detector/blob/master/pkg/healthchecker/types/types_test.go?
pkg/healthchecker/types/types.go
Outdated
LogPatternFlagSeparator = ":" | ||
|
||
nodeEnvKey = "HOST_IP" |
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.
To be consistent with the rest of the naming, could you change this variable name to hostIPKey
?
defaultKubeproxyPort = "10256" | ||
) | ||
|
||
var ( |
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.
Since these values are now public variables, they can be overwritten by other means. The only way I can think of preventing this is to have private strings and public functions that return those private values. Eg.
var kubeletHealthCheckEndpoint string
// Assign the value via setKubeEndpoints
func KubeletHealthCheckEndpoint() string { return kubeletHealthCheckEndpoint }
BTW, you might find https://pkg.go.dev/testing#T.Setenv useful for unit testing OS environment variables. |
2. expose endpoints via functions 3. add test cases 4. rename host addr var
/lgtm Thanks for your contribution! |
/assign andyxning |
/unassign andyxning |
/assign vteratipally |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
/assign @vteratipally |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mmiranda96, raghu-nandan-bs, vteratipally 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 |
Enable users to optionally provide node's IP and kubelet, kube-proxy ports.
If users do not wish to run node-problem-detector pod in host network mode, or if the kubelet / kube-proxy's ports are modified from its default value for some reason, we should be able to support configuring endpoint accordingly for performing health checks.