-
Notifications
You must be signed in to change notification settings - Fork 6
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
Potential overrides in name caused by lack of namespace #17
Comments
Why not add the namespace explicitly in every |
Yes, that's definitely an option, but I did not include it as a solution because I thought that maybe is not a useful information for the adaptor as it does not bring anything meaningful for it. But it is definitely an option. |
I like what @ljakab proposes about including the On the other hand, I also wonder if we are creating too much parsing/handling for the Adaptor. One of the roles of the Reader was to make the Adaptor life easier so I don't know how much complexity we want to introduce in the Reader-Adaptor API. |
I think the simplest thing is to just having it like this plus the Example:
As for the adaptor, I don't remember how Jordi stores the objects but I think it doesn't need to do any parsing as it already has all the information it needs at first glance on the |
Yes, the open API spec for the adaptor restricts On the other hand, it is unclear how the SDWAN controller will handle the same endpoint with different |
I don't really have a deep knowledge about SD WAN, but it's something that we have already been doing, if you remember: when I was delivering events to you, the namespace name was already included, just not explicitly. |
Based on the discussion, I'm leaning towards having just |
I like this because it gives a sort of fully qualified name for the endpoint and is fine on reader's side, but it is not for adaptors if they have a need to know parent namespace an service names (I don't know the reason, maybe for grouping things or for future features, I don't know). Which fortunately I'm guessing it is not the case. This is because every Kubernetes object name must respect RFC1123 (link) and this means that |
Makes sense for me, and since the adaptor only uses IP address and port, it won't be a problem, and can help in the future. However, is it possible to have the same endpoint value in two different namespaces? |
I like this struct or object definition for |
If you mean names yes. You could have
Yes I agree that having everything in separate fields is probably the best solution. @jordipv: are you storing state in your dictionary by |
Great, as long as there is no address overlap works fine for me! Yep, the adaptor indexes buy |
If we are to use this structure, would it make sense to use |
We could, but I would not do it as it would be redundant, as the object is already of type |
TL;DR
In some cases, especially with manual insertions and
dns
, some services may overlap.To avoid this, from now on
Name
s sent asEvent
will follow the same convention as Kubernetes service names and have a dns-like format, e.g.:nodejs-k89sv54jf7.production
, although the first part really being the endpoint name.Current situation
Currently, a service is sent to adaptors as following:
This is fine, but I just noticed that the two equal names
my-service
but in two different namespaces will cause a adaptors to override pre-existing values.Service Directory
If I remember right, when testing with the services pulled from Service Directory with @jordipv, we found that the names contain the full path as found in there - something along the lines of
/projects/my-project/locations/us-west-4/namespaces/prod/services/my-service/endpoints/my-service-sjr8ksf0
(I realized I wasn't re-formatting names, but this wasn't really necessary at that time). So this prevented overrides until now, but may cause issues for other services. Apart from being very un-readable of course.When can this happen
This can happen very easily with
DNS
when a service has multipleA
orAAAA
records. TBF, the chances of this happening are high only for records inserted manually, as the Operator already takes care of this.Name convention
In order to avoid confusion,
Name
will follow the same convention as Kubernetes service names and have a dns-like format, e.g.:nodejs-k89sv54jf7.production
, although the first part really being the endpoint name. Retrieving the service name is easy: if the metadata containsowner: cnwan-operator
, then the name can be extracted by removing the last-<10 characters>
from the endpoint name.A PR will come and introduce this for Service Directory as well. Also, this convention will be mentioned in the docs.
The text was updated successfully, but these errors were encountered: