-
Notifications
You must be signed in to change notification settings - Fork 154
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
osquery won't install when deployed via Elastic Agent integrations on k8s #1540
Comments
From @michalpristas initial look at this problem:
|
This issue doesn't have a |
We have another report of something similar happening with the files used for Beat lightweight modules when run on k8s, producing log messages like: {"log.level":"error","@timestamp":"2022-10-14T17:03:00.903Z","log.logger":"registry.lightmodules","log.origin":{"file.name":"mb/lightmodules.go","file.line":147},"message":"Failed to list light metricsets for module uwsgi: getting metricsets for module 'uwsgi': loading light module 'uwsgi' definition: loading module configuration from '/usr/share/elastic-agent/data/elastic-agent-d3eb3e/install/metricbeat-8.4.2-linux-x86_64/module/uwsgi/module.yml': config file (\"/usr/share/elastic-agent/data/elastic-agent-d3eb3e/install/metricbeat-8.4.2-linux-x86_64/module/uwsgi/module.yml\") must be owned by the user identifier (uid=0) or root","service.name":"metricbeat","ecs.version":"1.6.0"} |
Bumping this from 8.7 to 8.6 |
I worked around this by adding a |
@jmbass can you please provide the postStart sample you used ? We might need to provide this workaround to a customer of ours |
@gizas On the daemonset/deployment template spec:
Be wary to use the right osquerybeat version for your elastic agent in the command. |
for the postStart hook, you could wildcard the path (presumably there would only be one version in that directory?). notably, this does require a restart of the elastic-agent container after osquerybeat install. I guess if you wanted to be really hacky, you could try to have this run periodically regardless of whether elastic-agent is installed. |
Just doing a bit our DYI sleuthing:
Using postStart has no timing guarantees, agent will have already started potentially osquery will have also already started and died before the postStart hook is scheduled to run. A more robust work around would be to add a new startup/entrypoint script via a configmap, to correct the file permissions before agent has the chance to start: ConfigMap:
Now edit agents mounts to include the config map:
Then change the container start command:
The long term fix, I think, might be for the container to be built using the owner UID:0 to match how elastic-agent will run. |
Just to document some of the DM conversations: It looks like there is some miscommunication between the teams. It looks like we need some consistent approach and the story for our users. And if we are to support both scenarios, this should be documented, since, as of now, the instructions on Kibana will lead to broken osquery integration. ![]() |
This will be resolved by #4925 |
Hi, I deployed Endpoint and Agent 8.4.x into the daemonset on my self-managed k8s cluster per this yaml, and then deployed osquery via Fleet Integrations.
Upon deployment, I see this error in the agent logs:
this suggests that osquery extensions must not have write permissions for non-privileged accounts.
Yet after install, if I ssh into the daemonset I see this:
elastic-agent
has write priv toosquery-extension.ext
which is triggering that error.If I
chown root:root osquery-extension.ext
in the elastic agent container in the daemonset, osquery works as expected.Seems like
osquery-extension.ext
needs to somehow be owned byroot
when installed into k8s daemonset via Agent via Integrations?The text was updated successfully, but these errors were encountered: