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

Add samples for Beats setup #2041

Merged
merged 10 commits into from
Oct 28, 2019
Merged

Add samples for Beats setup #2041

merged 10 commits into from
Oct 28, 2019

Conversation

pebrc
Copy link
Collaborator

@pebrc pebrc commented Oct 22, 2019

I used these manifests for testing but thought it might be helpful for others as well to have them in our samples directory.

  • set up a monitoring cluster
  • connect Filebeat and Metricbeat to that cluster
  • Filebeat and Metricbeat are modified versions of the official manifests

k8s-app: metricbeat
spec:
serviceAccountName: metricbeat
hostNetwork: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does the deployment need access to the host network?

Copy link
Contributor

@thbkrkr thbkrkr Oct 23, 2019

Choose a reason for hiding this comment

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

It is to report the actual hostname of the machine and not the name of the metricbeat container when fetching node-wide metrics from kube-state-metrics (elastic/beats#7463).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if something prevents the use of the downward API to inject the NODE_NAME and set it as the beat name (used instead of the hostname when defined).

cc @exekias

Copy link

Choose a reason for hiding this comment

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

We indeed use this to report host metadata, by using the add_host_metadata processor. We could consider copying NODE_NAME to host.name, but would lose the rest

@anyasabo
Copy link
Contributor

API version nits and a question about the deployment. I know that is what the upstream yaml has but I was still curious why. Upstream already updated all the api versions I'm pretty sure.

I didn't get a chance to use this yet but it seems super useful. It also seems like this is a very good candidate for a helm chart because of all the hardcoded name references. I'm coming around to the idea of a helm chart that would deploy the operator and the config you just provided.

@pebrc
Copy link
Collaborator Author

pebrc commented Oct 23, 2019

Interestingly the upstream Metricbeat and Filebeat manifests still use the beta versions.

@thbkrkr
Copy link
Contributor

thbkrkr commented Oct 23, 2019

Interestingly the upstream Metricbeat and Filebeat manifests still use the beta versions.

It seems that since elastic/beats#13851 and elastic/beats#14046, there is no more beta versions.

> curl -s https://raw.githubusercontent.com/elastic/beats/master/deploy/kubernetes/metricbeat-kubernetes.yaml | grep apiVersion | sort | uniq -c
      2 apiVersion: apps/v1
      2 apiVersion: rbac.authorization.k8s.io/v1
      5 apiVersion: v1

@thbkrkr
Copy link
Contributor

thbkrkr commented Oct 24, 2019

It might also be convenient to create the beats namespace through the YAML manifest?

apiVersion: v1
kind: Namespace
metadata:
  name: beats

@exekias
Copy link

exekias commented Oct 24, 2019

Nice to see this happening! we were in the process of adding exactly this, but the other way around, see elastic/beats#14131. A later step would be to add this to the Beats docs.

host: ${NODE_NAME}
hints.enabled: true

setup.dashboards.enabled: true
Copy link
Member

Choose a reason for hiding this comment

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

Hey! How about moving all these kibana related stuff to the Deployment config map?

Deployment stands as a singleton for the whole cluster so it will far less expensive to load the dashboards from there instead of from each of the Daemonset instances.

Also maybe using env vars for the KIBANA_HOST and KIBANA_PORT might make it prettier.

See also: https://github.com/elastic/beats/pull/14131/files#diff-6c4e791fd61d7fd51348955d49d87917R219

Copy link
Collaborator Author

@pebrc pebrc Oct 24, 2019

Choose a reason for hiding this comment

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

I followed your examples and fixed up my metricbeat config. I am not sure about where the right place for these examples is, feels wrong to duplicate it in both repos?

I also raised #2051 to discuss next steps

@thbkrkr
Copy link
Contributor

thbkrkr commented Oct 25, 2019

jenkins test this please

Copy link
Contributor

@thbkrkr thbkrkr left a comment

Choose a reason for hiding this comment

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

LGTM.

@pebrc pebrc merged commit 12e9420 into elastic:master Oct 28, 2019
pebrc added a commit to pebrc/cloud-on-k8s that referenced this pull request Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants