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

Add support for notReadyAddresses #25

Merged
merged 10 commits into from
May 20, 2017
Merged

Conversation

Gsantomaggio
Copy link
Member

Fixes #24

Add K8s StatefulSets example

%%
maybe_ready_address(Subset) ->
case proplists:get_value(<<"addresses">>, Subset) of
undefined -> autocluster_log:info("No nodes ready yet!"), [];
Copy link
Member

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!", [])

Copy link
Member Author

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:

  1. Since the StatefulSets can start the POD sequentially, most likely is the first node.
  2. Consider notReadyAddresses as possible nodes to join and trust on auto-delay startup to join this node.

%%
maybe_ready_address(Subset) ->
case proplists:get_value(<<"addresses">>, Subset) of
undefined -> autocluster_log:info("No nodes ready yet!"), [];

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?

Copy link
Member

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.

Gabriele Santomaggio and others added 3 commits May 17, 2017 15:35
Add more items to the test
Add more items to the test
@theckman theckman mentioned this pull request May 20, 2017
@michaelklishin michaelklishin merged commit 31aca27 into stable May 20, 2017
@michaelklishin
Copy link
Member

@Gsantomaggio this needs a manual merge into master.

@dumbbell dumbbell deleted the rabbitmq-autocluster-24 branch January 2, 2018 17:20
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.

None yet

3 participants