-
Notifications
You must be signed in to change notification settings - Fork 142
Host name determination from k8s api #563
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
Host name determination from k8s api #563
Conversation
Pull Request Test Coverage Report for Build 13444567631Details
💛 - Coveralls |
|
ran e2e locally and all 27 of them passed @dougbtv |
pkg/storage/kubernetes/ipam.go
Outdated
| return normalizedIP | ||
| } | ||
|
|
||
| // TODO: what's the best way to discover the node name? this should work in both controller pod and whereabouts host process |
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.
Let's update this line with:
getNodeName prefers an OS env var of NODENAME, or, uses a file named ./nodename in the whereabouts configuration path.
dougbtv
left a comment
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.
just some nits to clean up, thanks for this one Ben
pkg/storage/kubernetes/ipam.go
Outdated
| return "", err | ||
| file, err = os.Open("/etc/hostname") | ||
| if err != nil { | ||
| logging.Errorf("Error opening nodeNameFile, defaulted to /etc/hostname: %v", err) |
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.
let's change this to:
logging.Errorf("Could not determine nodename and could not open /etc/hostname: %v", err)
AWS and GCP host name on /etc/host differs so we need to standardize the way we resolve the node name on the host Contributer: @dougbtv the goat Signed-off-by: Benjamin Pickard <[email protected]>
36f4ecf to
a443e51
Compare
dougbtv
left a comment
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.
lgtm! appreciate it Ben
|
e2e test is flaking in the same spots. it's unrelated. thanks Ben, appreciate you spiffing it up. |
Host name in /etc/host can differ from the nodename in the k8s API, so we standardize the way we calculate the hostname -- always from the K8s API, and then write it to a file on the host so that the CNI plugin side can always read it.
Contributer: @dougbtv the goat