-
Notifications
You must be signed in to change notification settings - Fork 81
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
separate "bootstrap" from retrieved config when running in agent mode #3464
Comments
I think the root of our problems is that agent overwrites the outputs from the policy with the bootstrap output. This makes the bootstrap process less complex from Fleet Server's perspective. We need agent to always pass the outputs from the policy and just augment them with the bootstrap output, because there is no guarantee that the initial bootstrap output remains valid over the complete life of fleet server since it is set only at install time. We could include the bootstrap output as a second output unit separate from the ones in the agent policy. Agent would always inject it so that Fleet server always receives two output units. Another options if adding a second output unit is too complex is to create a output:
elasticsearch:
hosts: '${ELASTICSEARCH_HOSTS:https://localhost:9200}'
service_token: '${ELASTICSEARCH_SERVICE_TOKEN}'
ssl.ca_trusted_fingerprint: '${ELASTICSEARCH_CA_TRUSTED_FINGERPRINT}'
bootstrap:
hosts: 'https://bootstrap:9200'
service_token: '${ELASTICSEARCH_SERVICE_TOKEN}'
ssl.ca_trusted_fingerprint: '${ELASTICSEARCH_CA_TRUSTED_FINGERPRINT}' |
Having agent always pass the outputs from the policy works around the edge case in the description, because agent always has a cached copy of the most recent policy on disk. If the bootstrap output is offline for whatever reason, Fleet server is still going to receive the other outputs from this local persisted copy of the policy from the agent. |
Note that reloading output from policy has been reverted: #3495 |
Follow up for #3411
fleet-server has been altered so that in agent-mode the policy self-monitor can send partial config updates to change output settings based off the output section of the fleet-server policy.
However this can introduce an edge case when the server is running where a policy-change unrelated to the output will result in the "bootstrap" output sent from the elastic-agent being used temporarily.
The sequence of events may be:
The issue here is the final reload where the fleet-server because the reload operation will restart the API server.
When receiving new output fleet-server may need to determine how to insert/inject output (and the revision idx value) into the config so that the output from policy does not trigger a second reload.
The text was updated successfully, but these errors were encountered: