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

Check if vip interface exists #89

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

ojmhetar
Copy link
Contributor

If the specified interface does not exist, keepalived will repeatedly kill and respawn a child process. keepalived will not fail fast on an "invalid" configuration, since in some situations it is possible that the interface may come up later. (Is this behavior we want to preserve during init?)

If keepalived is not fully operational, it will not route requests to the APIServer which will cause problems further in the init process.

Copy link

@nirmoy nirmoy left a comment

Choose a reason for hiding this comment

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

it would be nice to check the vip interface using net.InterfaceByName(iface) than exec.

@sarun87
Copy link
Contributor

sarun87 commented Jan 16, 2019

@ojmhetar I see that keepalived release 2.0.9 has some improvements around handling startup when interfaces aren't present
quote from: http://www.keepalived.org/changelog.html

  • Improve handling of interfaces not existing when keepalived starts.

Might be worth checking if that helps.

@ojmhetar
Copy link
Contributor Author

After trying keepalived:2.0.10, I found that while it does not run with an non-existing interface, it exits with status 0.

Thu Jan 17 22:10:46 2019: Non-existent interface specified in configuration
Thu Jan 17 22:10:46 2019: Stopped - used 0.000000 user time, 0.001005 system time
Thu Jan 17 22:10:46 2019: Keepalived_vrrp exited with permanent error CONFIG. Terminating
Thu Jan 17 22:10:46 2019: Stopped Keepalived v2.0.10 (11/12,2018)
*** /container/run/process/keepalived/run exited with status 0

config.Networking.PodSubnet, config.MasterConfiguration.Networking.PodSubnet))
}
}
if config.MasterConfiguration.Networking.DNSDomain != config.Networking.DNSDomain {
errorList = append(errorList, fmt.Errorf("configuration conflict: Networking.DNSDomain=%q, MasterConfiguration.Networking.DNSDomain=%q. Values should be identical, or MasterConfiguration.Networking.DNSDomain omitted",
config.Networking.DNSDomain, config.MasterConfiguration.Networking.DNSDomain))
}
if config.VIPConfiguration.RouterID != -1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi Ojas, just curious why not look for NetworkInterface itself here, i think we have a separate check where we verify that both RouterID and NetworkInterface are provided.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea was to only error here if this cluster is intended to be HA. If interface is empty, it could be done intentionally for a non-HA cluster.

Copy link
Contributor

@puneetguptanitj puneetguptanitj left a comment

Choose a reason for hiding this comment

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

lgtm, just had a small question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants