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

Shorten peering ids, filter out IPv6/ARPA names #569

Merged
merged 4 commits into from Oct 21, 2020

Conversation

nolar
Copy link
Owner

@nolar nolar commented Oct 21, 2020

Improve peering identities in IPv6 environments: ignore special ARPA hostnames of reversed IPv6 addresses, and prefer the actual hostnames of the pods/machine.

Previously, pseudo-hostnames like 1.0.0.0.....0.0.ip6.arpa were selected, as this is how stdlib works with socker.getfqdn() — it is not very suited for IPv6, only IPv4.

As a side effect of having our own implementation, also drop useless suffixes like .local for Mac OS — also to improve the readability of the peering ids.

And also, convert timestamps of the operator start time to just a long number.

Was:
nolar@1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/2020-10-21T20:51:11.618987/vy08ew

Now:
nolar@SV-Pro/20201021205056/dqp

These peering ids are visible in the messages about conflicting operators:

[INFO    ] Freezing operations in favour of [Peer(nolar@SV-Pro/20201021205206/c4g, namespace=default, priority=100, lastseen=2020-10-21 20:53:09.715236, lifetime=0:00:10)].

Generally, a peering id MUST be a unique string; SHOULD help the developers to identify where the operator runs (or who does that). No other obligations regarding the structure or hostname accessibility. Therefore, by changing the internal structure of the peering ids, the backward compatibility is not affected.

With IPv6, the peering operators often got the identities like `1.0.0.0...0.0.ip6.arpa`, which does not make it easier to identify the pod where the operator is running. This is because of how `socket.getfqdn()` works — it does not exclude IPv6 pseudo-hostnames properly.

With this fix, the operators' identities in IPv6 environments will return back to normal pod names.
For `kopf freeze` and `kopf resume`, the identity of the actor must be stable — especially for resuming, as it must remove the peering record of the same identity it added previously, not the new one every time (due to timestamps or random suffixes).
@nolar nolar added the enhancement New feature or request label Oct 21, 2020
@nolar nolar merged commit 93dc9ac into master Oct 21, 2020
@nolar nolar deleted the peering-identities-ipv6 branch October 21, 2020 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant