skydive
skydive copied to clipboard
gremlin: shortestPathTo from pod to lookback failing
The context of this is connecting k8s.pod to flows by using the following sequance:
k8s.pod --> k8s.container --> docker.container --> docker.namespace --> lo (flows)
Using Gremlin I would like to be able to highlight the path from a pod to its' respective lo device.
When attempting to do so I was able to get path when providing the lo TID:
g.V().Has("Type", "pod", "Name", "wordpress-7bdfd5557c-svxpg").ShortestPathTo(Metadata("TID", "a4d94097-0920-5ce1-6b13-c1ba87b183d6"))
Yielding:
But when I try to provide a generic gremlin:
g.V().Has("Type", "pod", "Name", "wordpress-7bdfd5557c-svxpg").ShortestPathTo(Metadata("Name", "lo"))
I get following (yellow marking the path I was expecting ...):
When running as the filter I notice two issues: (1) path uses the k8s.node --> host association (I would like to mark that this should not be used) (2) query returns a non-stable result, even when the actual topology is stable
The reason is that shortestpath doesn't support n to n path but provide only 1 to 1 path. We need to work on a fix.
So do we want to change ShortestPathTo() or add a new gremlin step ?
I think can handle the n to n thing as the current API leads to think that is possible to do n to n.
ok ... any guidance in case I want to attempt to extend it myself ?