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
Basic Kubernetes Integration #441
Conversation
@@ -16,7 +16,6 @@ import ( | |||
"time" | |||
|
|||
docker "github.com/fsouza/go-dockerclient" | |||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
e209cca
to
257c3db
Compare
func (k *client) RemoveEventListener(c chan watch.Event) error { | ||
k.lock.Lock() | ||
defer k.lock.Unlock() | ||
return k.removeEventListener(c) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
7134805
to
fe70172
Compare
caad1b2
to
fd06706
Compare
2917be9
to
914ed83
Compare
) | ||
err := r.client.WalkServices(func(s Service) error { | ||
nodeID := report.MakeServiceNodeID(s.Namespace(), s.Name()) | ||
result.Nodes[nodeID] = s.GetNode() |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
if s := strings.SplitN(id, "/", 2); len(s) == 2 { | ||
result.LabelMajor = s[1] | ||
result.Node.Metadata[kubernetes.Namespace] = s[0] | ||
result.Node.Metadata[kubernetes.PodName] = s[1] |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Quick first pass; it looks pretty good. Shame we can't make the connections work properly; something to come back to perhaps. |
@tomwilkie I suspect the connections is something obvious I'm missing, but yeah. Definitely to revisit. |
Make sure we have a bug to track the connection improvements. |
@@ -96,6 +97,9 @@ func makeReportPostHandler(a xfer.Adder) http.HandlerFunc { | |||
return | |||
} | |||
a.Add(rpt) | |||
if len(rpt.Pod.Nodes) > 0 { | |||
addKubernetesTopologies() | |||
} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
e9b28e9
to
7c6878d
Compare
I believe I've addressed all concerns with this, so if you could have another quick look, and let's merge this. |
I haven't tested the code myself (involved setting up k8s). And I'm hesitant as I don't think anyone will be regularly running this, so I very much expect it to bit rot. But given its not enabled by default, the risks of merging this are minimal. LGTM. |
Pls squash! |
I'll give it a review at EOD. Please wait until then :) |
r.RLock() | ||
defer r.RUnlock() | ||
return r.items | ||
} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
re: the racy thing, in the best case, you could return a deep copy, but I recognize that's super annoying... maybe just a warning comment on get and list methods to not modify the return values? Other than those little nits, LGTM. |
* Added helper for installing scope on gcloud * Added topologies Pods and Pods-by-Service * Uses k8s.io/kubernetes/pkg/client/cache for the client * Filter kube-system nodes by default * Only show the k8s topologies if we've received a non-empty k8s report
671277e
to
be1d1d5
Compare
Basic Kubernetes Integration
@tomwilkie, @peterbourgon any feedback would be great.
I'm not super-happy with the result, as there are still some shortcomings:
--probe.kuberetes true
flag on the master node to enable it (for now).In the example, there are:
Screenshots of it:
Pods view. I'm not sure if we should show the "2 containers" under each node, or if we should skip that.
Pods-by-Service view, where pods are grouped when they belong to a common service
As you can see, all the connections routing through "Uncontained" makes the output mostly useless. However, we can filter out the loads of kube-system pods, which clutter up the view considerably.