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

feature(kubernetes plugin): Adds support for a kuberentes plugin #635

Closed
wants to merge 1 commit into from

Conversation

jchauncey
Copy link

fixes #569
This commit also refactors the existing docker plugin so that the
kubernetes plugin can gather metrics from the docker system.

fixes influxdata#569
This commit also refactors the existing docker plugin so that the
kubernetes plugin can gather metrics from the docker system.
@jchauncey
Copy link
Author

ok not sure why its failing on building the binary. The kubernetes dep was downloaded it seems.

edit: nevermind it does download the repo it just takes a while

@jchauncey
Copy link
Author

@sparrc im not sure whats going on here. Does gdm actually download the repo? Or just attempt to checkout the revision?

@jchauncey
Copy link
Author

so I think the test failures are because it hasnt fully downloaded the kubernetes repo and its trying to go ahead and build the telegraf client. Not sure how to proceed

@sparrc
Copy link
Contributor

sparrc commented Feb 3, 2016

@jchauncey I'll checkout your changes and take a look

@sparrc
Copy link
Contributor

sparrc commented Feb 3, 2016

I get this error:

% go get ./...
# k8s.io/kubernetes/pkg/util/parsers
../../../k8s.io/kubernetes/pkg/util/parsers/parsers.go:30: undefined: parsers.ParseRepositoryTag

it seems like there are dependency issues here....tip of master docker parsers doesn't have that function: https://github.com/docker/docker/blob/master/pkg/parsers/parsers.go

@jchauncey
Copy link
Author

Yeah you need the sha that is pinned for the docker/docker repo in go deps
On Feb 2, 2016 6:55 PM, "Cameron Sparr" notifications@github.com wrote:

I get this error:

% go get ./...

k8s.io/kubernetes/pkg/util/parsers

../../../k8s.io/kubernetes/pkg/util/parsers/parsers.go:30: undefined: parsers.ParseRepositoryTag

it seems like there are dependency issues here....tip of master docker
parsers doesn't have that function:
https://github.com/docker/docker/blob/master/pkg/parsers/parsers.go


Reply to this email directly or view it on GitHub
#635 (comment).

@sparrc
Copy link
Contributor

sparrc commented Feb 3, 2016

Is adding 14 new dependencies really the only way to get the kubernetes tags? Isn't there some kind of simple API to get the same information without all of these huge client libraries?

Adding this PR will also require hand-editing the Godeps file from now on

@jchauncey
Copy link
Author

No this is the crappy thing about talking to the kube api. We've been
dealing with this in every deis project and it sucks. That's why I was
asking about using glide earlier. With the vendor directory and a glide
lock file it helps relieve so of the issues with pulling down the
kubernetes deps.
On Feb 2, 2016 7:00 PM, "Cameron Sparr" notifications@github.com wrote:

Is adding 14 new dependencies really the only way to get the kubernetes
tags? Isn't there some kind of simple API to get the same information
without all of these huge client libraries?

Adding this PR will also require hand-editing the Godeps file from now on


Reply to this email directly or view it on GitHub
#635 (comment).

@jchauncey
Copy link
Author

Sorry I didn't answer your question. Yes this is really the only way to talk to the kube api without using kubectl

@sparrc
Copy link
Contributor

sparrc commented Feb 3, 2016

It built fine for me on OSX, but this change also increases the size of the binary by 63% (from 32M to 52M). I'm really not sure this is something that I want part of the Telegraf repo, I'll have to think on it.

unfortunate that the kubernetes api is so cumbersome, given the circumstances I wouldn't be opposed to having this plugin require the kubectl binary as a dependency and executing that.

@jchauncey
Copy link
Author

@sparrc going to give the repo at the bottom of this issue a try tomorrow kubernetes/kubernetes#11606

@jchauncey
Copy link
Author

@sparrc
Copy link
Contributor

sparrc commented Feb 3, 2016

interesting that the Go authors are maintaining a Kubernetes api library, hopefully it has enough capabilities for this plugin 👍

@jchauncey
Copy link
Author

So we have decided we are going to spend some time and see if we can build a light weight kubernetes api for people to use. Seems like the right thing to do since a lot of people are needing one. I'll update the PR when we get it done.

@sparrc
Copy link
Contributor

sparrc commented Feb 3, 2016

great! 💯

closing this PR for the time being then

@sparrc sparrc closed this Feb 3, 2016
@Raffo
Copy link

Raffo commented Feb 7, 2016

@jchauncey Any chance we can collaborate on that? I was about to do the same, starting from the link you posted...

@jchauncey
Copy link
Author

I think it might be fruitless now that I've spent a few days on it. If you
want a feature complete client you basically need what they have in the
main kubernetes repo. I have managed to reduce the deps on that repo to 13
but I can't go any further.

If influx doesn't want to increase the size of the binary then I'll just
maintain my own fork that includes the plugin.
On Feb 7, 2016 8:24 AM, "Raffaele Di Fazio" notifications@github.com
wrote:

@jchauncey https://github.com/jchauncey Any chance we can collaborate
on that? I was about to do the same, starting from the link you posted...


Reply to this email directly or view it on GitHub
#635 (comment).

@Raffo
Copy link

Raffo commented Feb 7, 2016

Ok, this means that problem must be addressed again in the kubernetes repo. It's not reasonable to have clients of Kubernetes that are that big. Thanks for the reply, anyway.

@sparrc
Copy link
Contributor

sparrc commented Feb 7, 2016

@jchauncey what about the golang kubernetes library (https://godoc.org/golang.org/x/build/kubernetes)? Does that not have the ability to get kubernetes tags?

@jchauncey
Copy link
Author

It can get the labels but using it within an existing kube cluster is a
little more difficult. You need to authenticate to talk to the kubeapi from
within a pod. It lacks this capability and adding it would require me to
basically pull in the deps that the main kube client already has. I'm not
sure it would reduce the size in the end.
On Feb 7, 2016 10:38 AM, "Cameron Sparr" notifications@github.com wrote:

@jchauncey https://github.com/jchauncey what about the golang
kubernetes library (https://godoc.org/golang.org/x/build/kubernetes)?
Does that not have the ability to get kubernetes tags?


Reply to this email directly or view it on GitHub
#635 (comment).

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.

kubernetes input plugin
3 participants