-
Notifications
You must be signed in to change notification settings - Fork 733
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
Proposal: Beat "presets" #3190
Comments
Thanks for the write up @sebgl! My 2 cents below. I think the concerns you listed can be divided into two groups: DefaultsDefault config comes with podTemplate that is not suiteable if a different config is used. To have Beats working there are many moving parts, but I think that's just in the nature of the problem. Still, many of the things listed in the issue will be addressed:
If we still feel that's not enough if the users wants to do the setup themselves, we could provide a flag (in Config merging is complicatedI think this is orthogonal to presets. We can have the proposed IIUC, the proposal is about providing a number of default configs per Beat to address different use cases. It was considered already (although in a bit different form):
I do see couple more issues:
Maybe we can do something a little bit different and achieve the same goals. The way I see it, a preset is a beatConfig+podTemplate for a particular Beat type. Which is what Beat CR itself is :) Could we get similar UX by just providing recipes with Beat CR for different scenarios? This would be similar to current recipes (not production ready, might require hardening, we can change them without figuring out upgrade story, etc.). Users could use it as a starting point and tune it as needed, which is what we expect would happen with presets too. We can also decide to postpone adding this until we get some feedback. It seems it can be added at any time. |
In your proposal I think it might also make sense to make the config and preset fields mutually exclusive. You either use our presets or you provide the whole config (minus the output I suppose).
I don't quite understand this issue since we are already committing to this for each beat default in the current proposal.
It's not clear to me that this is actually a good default, it seems like using the downward API to get the node name provides the same thing without any of the downsides / permissions issues. |
Summary of a discussion we had with @david-kow @anyasabo @pebrc:
|
The minimum prerequisite for introducing this feature would be to remove any existing defaults, volume mounts and RBAC settings from #3041 (or a quick follow-up PR). We can then in a separate decision introduce the presets (or play around with sample configurations external to the controller) It would also be helpful to ask for feedback for the CRD and this idea in particular from @\elastic/integrations-platforms |
If we remove this default then the Beat CRD is basically useless or very hard to use? |
You could have example configs to go with it. I think I am OK with removing the defaults together with the preset PR if it is before an initial release. Once we release the Beats CRD even if it is still alpha, removing the defaults would be a breaking change, that we should avoid if possible. |
I think I agree with pebrc. I am still wrestling with the value of having the presets built in to the controller, vs starting out with having an example library of common use cases in our docs and potentially adding presets later. My inclination is to start smaller with a basic beat. Adding things is easier than taking them away in the future. It also makes me wonder if stack monitoring would still make sense as a separate CRD or if it makes sense to include as a preset (either in documentation or codified). |
I agree on removing the defaults, but I think we should have presets (or some other way?) to specify a working config. All our other CRDs can have great startup experience with 10-liners specifying all that's needed for simple quickstart. Meanwhile, Beat will need a fairly complicated, unreadable 50-100-150 lines of config which we will probably end up hiding behind Also, having preset (or any other built-in config mechanism) together with |
Hi, sorry if I am joining late to this discussion as my thoughts are going to be a bit against "presets" 😅 Also I am not familiar with current operator, so I may be missing some basic things that may have already been discussed. I would like to position my comments starting on the deploy manifests we currently maintain in the Beats repo (here), and how they use to be used. They use to be used as they are, and customized as needed following some comments in the same yaml file. One way of supporting beats in the operator could be to move the knowledge in these manifests and its comments to the controller. For example one thing we comment in the filebeat manifest is that to use autodiscover, you need to remove
Other usual thing to customize is the logs path, this could be another setting:
Another common thing to do is to enable or disable some things if the beat is deployed in a secured kubernetes, like OpenShift. For example filebeat needs to be privileged to read the logs in some environments. Maybe the operator is able to dectect this and set the proper options, if not, a setting for this may be needed:
Only for the combinations of this three quite popular variations we would need lots of presets, but they can be modelled as some clear options. Support for these options could be added on different iterations.
A case like this could be covered with options like this:
The user could specify the path as it is in the host, and the operator could then mount One particularity that metricbeat has is that we recommend deploying for it a daemonset and a deployment. The daemonset is intended to collect metrics locally on each node, and the deployment to collect cluster metrics from kube state metrics. A config like the following one could generate only a daemonset config with hints-based autodiscover, and nothing for kube state metrics:
Also, something that may have been discussed in the past, I wonder if we have considered to have a
We could still have the |
Thanks for your input @jsoriano, the timing is perfect :) I see the value in making Beat config more customizable from the CRD itself. It would allow us to address certain percentage of common setups with short and simple configs. At the same time it requires us to draw arbitrary line between what's easily customizable and what isn't. I'm not sure if that should be something that we do with Beats, but we didn't with any other CRDs we have. For context, having a generic Beat CRD was driven by the desire to support all Beats at once (including community Beats) instead of (probably limited) number of very similar
The above is mostly to give some more context why we chose this path initially :)
I think this is very valid question. Even if the user provides whole Beat config, operator takes care of:
And this is on top of having a "configless" start up experience if they chose to use the preset (if we decide to have one). I wonder if this "simplified" config approach was ever considered on the Beat config level ( |
+1 to avoid multiple sources of truth. If we support a limited number of options in the CRD, we probably shouldn't allow to add custom
Wouldn't these points talk in favour of having specific CRDs for each supported beat? So if
Yeah, this can be true, but I guess this would be a decision on the use cases we want to support on the operator. I think it can make sense to support only a limited number of options. Beats options combinatory is wide, and some possible combinations are error-prone (I am thinking in autodiscover hints vs. templates for example, but also what beats make sense as deployments, as daemonsets, or as both). I think we don't need to support all combinations for the Kubernetes use case.
Oh, this is great 👍
We try to provide defaults to cover basic use cases, so configuration can be simpler, for example enabling hints-based autodiscover in filebeat enables collection of logs for all pods, this works with kubernetes and docker providers:
This can be done in Filebeat because all logs are collected the same, but it wouldn't work on Metricbeat, where each container is going to need a different way of collecting metrics. Another example would be the |
I think it comes down to how much product specific complexity we can handle. I think you are right saying that many of the problems that I mentioned can be solved by having a separate We've looked at all the options (implicit defaults, explicit presets, no defaults) and decided to start with no defaults. We had already some people +1'ing on that approach. We will see what is the broader feedback and consider improvements based on that. You can see the gist for how full Filebeat/Metricbeat examples would look like. |
super late to this and far from a kubernetes expert but: I understand the reasoning for going no defaults here. I still like the idea of presets. Could we instead implement them just as documentation? "Cookbook" examples of how to get started with the operator and a specific use case, e.g. collect logs from all containers and then supply an example config file they can just "apply" to get up and running with that use case? In short, a one step guide to collecting logs from all containers, one step to collect metrics from hosts, etc. |
That's the plan for the time being. We already have a collection of recipes that we want to update for the Beats CRD |
I'd like to discuss here a proposal to change a bit the logic of the current Beat CRD.
Concerns
I want to address the following concerns:
/data/logs
directory with filebeat, you end up by default with many additional things and permissions you don't need:/proc
) if they don't want them.Proposal
elasticsearchRef
is specified, but don't set any other config setting:filebeat-k8s-autodiscover
: collect hint-based logs from all Pods, autodiscovered from the apiserver (also handles service account, role binding, etc.)filebeat-k8s-containers
: collect logs from all containers - does not rely on autodiscover from the apiservermetricbeat-k8s-hosts
: collect metrics from all k8s nodesmetricbeat-k8s-cluster-metrics
: collect metrics from the k8s cluster (in a single metricbeat instance)the podTemplate of all those presets can of course be overridden
if you want to include a lot of modifications it's probably easier to not use the preset and set your own podTemplate, config, and RBAC stuff
it gives us room to later on include other presets (for example, packetbeat) while keeping the same packetbeat default. Otherwise, the day we decide to set a packetbeat default means we'd break compatibility wit existing packetbeats resources.
I think we can tackle the config merging problem in case a preset is used, by allowing to override a few identified array items. Keep our current "merge-append" behaviour to be consistent with other CRDs, but allow some specific overrides (typed in the CRD):
elasticsearchRef
is specified)The text was updated successfully, but these errors were encountered: