-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add support for notReadyAddresses #25
Conversation
Fix config docker file configuration Expose AMQP port
src/autocluster_k8s.erl
Outdated
%% | ||
maybe_ready_address(Subset) -> | ||
case proplists:get_value(<<"addresses">>, Subset) of | ||
undefined -> autocluster_log:info("No nodes ready yet!"), []; |
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 this a typo or we return an empty list instead of an address? Or did you mean
autocluster_log:info("No nodes ready yet!", [])
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.
It is not a typo
We return an empty list, since the POD is still starting. Most likely is itself.
here we are in this situation:
"subsets": [
{
"notReadyAddresses": [
{
"ip": "172.17.0.2",
Where we have only not ready nodes.
Here I had two ways to handle this:
- Since the StatefulSets can start the POD sequentially, most likely is the first node.
- Consider
notReadyAddresses
as possible nodes to join and trust onauto-delay
startup to join this node.
src/autocluster_k8s.erl
Outdated
%% | ||
maybe_ready_address(Subset) -> | ||
case proplists:get_value(<<"addresses">>, Subset) of | ||
undefined -> autocluster_log:info("No nodes ready yet!"), []; |
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.
Log message is not strictly true, we might have several subsets: some have ready addresses and others not. If we want to notify that there are not ready addresses, we could do something like:
maybe_ready_address(Subset) ->
case proplists:get_value(<<"notReadyAddresses">>, Subset) of
undefined -> ok;
_ -> autocluster_log:info("k8s endpoint listing returned nodes not yet ready", [])
end,
case proplists:get_value(<<"addresses">>, Subset) of
undefined -> [];
Address -> Address
end.
@michaelklishin any thoughts?
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 is a good idea and will simplify debugging.
Add more items to the test
Add more items to the test
@Gsantomaggio this needs a manual merge into |
Fixes #24
Add K8s StatefulSets example