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

Added API variables so Kibana could access ES through the API server #5776

Merged

Conversation

jonlangemak
Copy link
Contributor

I noticed an issue when I was trying to get the fluentd-es-kibana addon running on my bare metal Kubernetes cluster. It appears that the Kibana container is statically configured to point to the local container to get to the API server. From the Kibana docker image run_kibana_nginx.sh...

elasticsearch: "https://"+window.location.hostname+"/api/v1beta1/proxy/services/elasticsearch-logging"

In my case, the API server lives on the master which doesn't host any other pods at all. That being said, I suggest adding the following ENV variables to the Kibana replication controller definition...

-API_PROTOCOL
-API_SERVER
-API_PORT

The PR has these values in the RC definition set to what the container defaults to now. That is...

API_PROTOCOL = HTTPS
-API_SERVER = localhost (logic in the script changes this to the local IP of the pod)
-API_PORT = "" (blank or default of 80)

I tested this by building a new docker image and ensured that the same URL is generated by Kibana for accessing data in ES. Besides adding the 'localhost' logic I just changed the way that the URL was generated by concatenating the ENV variables. I also put the set commands back in to spit certain ENV variables out to console so I could catch them with 'docker logs' during debugging.

@satnam6502
Copy link
Contributor

Thank you. Let me think about this. In your case, why not use one of the popular Kibana images instead and set their env vars appropriately?

@satnam6502 satnam6502 self-assigned this Mar 23, 2015
@jonlangemak
Copy link
Contributor Author

I guess I wasnt aware there were other Kibana images out there that would work for this use case. I was trying to keep with the addons that were bundled as part of the project but I see your point. To be honest, I guess Im a little confused on how this works in it's current state. Doesn't setting the ES URL value statically ,as it is now, imply that ES is running on the same host as Kibana? Or is there something in GCE that handles this differently which is why Im having issues on bare metal?

@satnam6502
Copy link
Contributor

Believe me, I understand your confusion. I had to drink a lot of whisky to make this work out. No, Kibana does not need to run on the same host as Elasticsearch and the URL is more to do with the vagaries of client-side scripting. In the original version of this work I used arcus/kibana

@satnam6502
Copy link
Contributor

Perhaps more later during the work week, but if you are running on a bar metal configuration that I think you may be better off using off the shelf images.

@jonlangemak
Copy link
Contributor Author

Sure thing. I'd like to try and understand how it's working as is but we can pick this up in the next day or two (or 3 or 4). When I used the scripts as they are, Kibana was failing trying to access the API server on the local host that Kibana was running on. So if I'm missing something on how that should work I'd like to start there. Thanks!!

@satnam6502
Copy link
Contributor

Let's work together on this 1:1 -- email me at satnam@google.com

@jonlangemak jonlangemak force-pushed the fluentd-elasticsearch-kibanafix branch from 70bff07 to 2aaef87 Compare March 25, 2015 00:51
@satnam6502
Copy link
Contributor

Sorry for the delay. This looks like a good idea, thank you.
Can you fetch/rebase the updated version of this file which now uses a gcr.io image?
Thanks.

@jonlangemak jonlangemak force-pushed the fluentd-elasticsearch-kibanafix branch from 2aaef87 to 35038dc Compare April 3, 2015 03:00
@jonlangemak
Copy link
Contributor Author

After much fiddling I think I got everything updated. Let me know if it looks ok to you, a lot of this if my first time doing stuff in Git so Im learning as I go.

Thanks!

@satnam6502
Copy link
Contributor

Thank you kindly for your patience and contribution!

@satnam6502 satnam6502 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 3, 2015
satnam6502 added a commit that referenced this pull request Apr 3, 2015
…afix

Added API variables so Kibana could access ES through the API server
@satnam6502 satnam6502 merged commit e4c91df into kubernetes:master Apr 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants