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

Launch Elasticsearch and Kibana automatically #3292

Merged
merged 1 commit into from
Jan 9, 2015

Conversation

satnam6502
Copy link
Contributor

This PR changes our setup to automatically launch an Elasticsearch pod for ingesting logs and a Kibana pod for viewing logs when logging with Fluentd to Elasticsearch is selected. The URLs for Elasticsearch and the Kibana dashboard are reported at cluster creation time:

.. setting up Fluentd to Elasticsearch logging with Kibana viewer
Created [https://www.googleapis.com/compute/v1/projects/kubernetes-elk/global/firewalls/fluentd-elasticsearch-logging].
NAME                          NETWORK SRC_RANGES RULES                      SRC_TAGS TARGET_TAGS
fluentd-elasticsearch-logging default 0.0.0.0/0  tcp:5601,tcp:9200,tcp:9300          kubernetes-minion

Cluster logs are ingested into Elasticsearch running at http://130.211.126.68:9200
Kibana logging dashboard will be available at http://23.236.59.213:5601

I have also changed the names of the Elasticsearch and Kibana pods and services (adding -logging) to avoid any name clashes with other instances of Elasticsearch in the cluster.

@@ -0,0 +1,25 @@
apiVersion: v1beta1
kind: Pod
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need to run under replication controllers, not bare pods. Monitoring is wrong here, too @vishh #2408

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I had intended to change this to have a replication controller (still with one controlled pod). I'll make the change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thockin: I am working on replication controllers. I will add them along with a few other enhancements to monitoring.

@satnam6502 satnam6502 force-pushed the es-kibana branch 6 times, most recently from dc655af to 1b2f57d Compare January 8, 2015 19:08
@satnam6502
Copy link
Contributor Author

@thockin : changed to using replication controllers, all yml files changed to yaml and updated documentation. PTAL.

@satnam6502 satnam6502 force-pushed the es-kibana branch 2 times, most recently from 11e55e5 to 73a298b Compare January 8, 2015 19:48
@satnam6502
Copy link
Contributor Author

I just did one more tweak to add tag version numbers to the two Dockerfiles that we create (both at tag 1.0 here) and then I mention this tag in the pod specs. This will allow us to update the logging work without breaking existing clusters.

@@ -38,6 +38,7 @@ PORTAL_NET="10.0.0.0/16"

# Optional: Install node monitoring.
ENABLE_NODE_MONITORING=true
ELASTICSEARCH_LOGGING_REPLICAS=1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be lumped with other logging flags, rather than with node-monitoring

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, my mistake, fixed.

@thockin
Copy link
Member

thockin commented Jan 8, 2015

If we use this at cluster setup, it needs to move to cluster/addons

@zmerlynn
Copy link
Member

zmerlynn commented Jan 9, 2015

This PR is going to cause a headache for GKE. Please make sure to be delicate around the GKE provider on the OSS side or you'll break GKE Jenkins. Check it as disable initially there, create a bug, assign it to me. I'll consider how to generically launch other pods when I'm looking at #3305.

(Looking further, looks like you default to off. Great!)

@satnam6502
Copy link
Contributor Author

For GKE, can we just set ENABLE_NODE_LOGGING=false ? Is that not good enough?

@zmerlynn
Copy link
Member

zmerlynn commented Jan 9, 2015

Yeah, you can just set it to false for now. It looks like it's default off if you don't plumb the variable through? (Or did I misread the PR?)

You can just "export KUBERNETES_PROVIDER=gke" and then "go run hack/e2e.go -up" etc. to get gke.

@satnam6502
Copy link
Contributor Author

@thockin : I think I have done your bidding. PTAL.
@zmerlynn : I will check the GKE provider to make sure I have not broken anything.
All other provider maintainers please note changes to config-default.sh
I also added a few missing --project flags which are needed when the project is set in config-default.sh @cjcullen @jlowdermilk @mbforbes

@satnam6502
Copy link
Contributor Author

@zmerlynn : running the e2e tests with the GKE provider did not give an encouraging result. Running with just -up works.

$ hack/e2e-test.sh
....
2015/01/08 19:55:48 Passed tests: certs.sh[1/1] goe2e.sh[1/1] monitoring.sh[1/1]
2015/01/08 19:55:48 Flaky tests:
2015/01/08 19:55:48 Failed tests: basic.sh[0/1] guestbook.sh[0/1] liveness.sh[0/1] pd.sh[0/1] private.sh[0/1] services.sh[0/1] update.sh[0/1]
2015/01/08 19:55:48 7 test(s) failed.
2015/01/08 19:55:48 Running: teardown
...

ENABLE_CLUSTER_LOGGING=false
if [[ "${ENABLE_NODE_LOGGING-}" == "true" ]]; then
if [[ "${LOGGING_DESTINATION-}" == "elasticsearch" ]]; then
if [[ "${ENABLE_CLUSTER_LOGGING-}" == "true" ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need all the logic, or can you just set the variable, or even just set it and comment the line out? Same for others...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I added that logic because you wanted the ELASTICSEARCH_LOGGING_REPLICAS definition guarded? Initially, I did just set the variable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I don't recall saying that. Maybe something I said was too cryptic? Either way, I think this should be a config file, not a program.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sure I just mis-understood you. Shall I remove two of the three tests, or just set the variable at the top-level like I did originally?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think simpler is better in the config files.

On Thu, Jan 8, 2015 at 8:40 PM, Satnam Singh notifications@github.com
wrote:

In cluster/aws/config-default.sh
#3292 (diff)
:

LOGGING_DESTINATION=elasticsearch # options: elasticsearch, gcp
+
+# Optional: When set to true, Elasticsearch and Kibana will be setup as part of the cluster bring up.
+ENABLE_CLUSTER_LOGGING=false
+if [[ "${ENABLE_NODE_LOGGING-}" == "true" ]]; then

  • if [[ "${LOGGING_DESTINATION-}" == "elasticsearch" ]]; then
  • if [[ "${ENABLE_CLUSTER_LOGGING-}" == "true" ]]; then

I am sure I just mis-understood you. Shall I remove two of the three
tests, or just set the variable at the top-level like I did originally?

Reply to this email directly or view it on GitHub
https://github.com/GoogleCloudPlatform/kubernetes/pull/3292/files#r22701289
.

@satnam6502
Copy link
Contributor Author

@thockin : moved predicate to inside the bring up and tear down functions for cluster logging; removed conditional guards for setting ELASTICSEARCH_LOGGING_REPLICAS. Tested. PTAL.

@zmerlynn
Copy link
Member

zmerlynn commented Jan 9, 2015

@satnam: Sorry, to test on GKE you'll also need --check_version_skew=false.

On Thu, Jan 8, 2015 at 8:01 PM, Satnam Singh notifications@github.com
wrote:

@zmerlynn https://github.com/zmerlynn : running the e2e tests with the
GKE provider did not give an encouraging result. Running with just -up
works.

$ hack/e2e-test.sh
....
2015/01/08 19:55:48 Passed tests: certs.sh[1/1] goe2e.sh[1/1] monitoring.sh[1/1]
2015/01/08 19:55:48 Flaky tests:
2015/01/08 19:55:48 Failed tests: basic.sh[0/1] guestbook.sh[0/1] liveness.sh[0/1] pd.sh[0/1] private.sh[0/1] services.sh[0/1] update.sh[0/1]
2015/01/08 19:55:48 7 test(s) failed.
2015/01/08 19:55:48 Running: teardown
...


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

@satnam6502
Copy link
Contributor Author

Yes, I finally worked that out after trying various configurations and good to know about --check_version_skew=false for reducing the output verbiage. Thanks.

@satnam6502 satnam6502 force-pushed the es-kibana branch 2 times, most recently from f9ae7bb to 5090cff Compare January 9, 2015 18:14
@@ -54,4 +54,6 @@ if [[ "${ENABLE_CLUSTER_DNS}" == "true" ]]; then
| "${KUBE_ROOT}/cluster/kubectl.sh" create -f -
fi

setup-fluentd-elasticsearch-logging
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last nit: rename to setup-logging

@satnam6502
Copy link
Contributor Author

Changed the bring up and tear down names to setup-logging and teardown-loging.
Merging with the approval of @thockin

satnam6502 added a commit that referenced this pull request Jan 9, 2015
Launch Elasticsearch and Kibana automatically
@satnam6502 satnam6502 merged commit d5d8049 into kubernetes:master Jan 9, 2015
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.

4 participants