Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

[fleet] fix elastic-agent setup #1076

Merged
merged 7 commits into from
Mar 8, 2021
Merged

Conversation

simitt
Copy link
Contributor

@simitt simitt commented Mar 8, 2021

What does this PR do?

Since recent changes of running Fleet Server when starting Elastic Agent (elastic/beats#24220) the elastic-agent setup was broken. This PR fixes the setup as far as possible.

There is one more change that needs to be merged into Kibana elastic/kibana#92422; until this PR is merged, the Elastic Agent enrollment endlessly waits for the policy to be written by Kibana. One should see the following log line in the Fleet server logs:
{"message":"Waiting on policy with Fleet Server integration: d5204d20-7fee-11eb-9337-e79c33f6692e"}

Why is it important?

To be able to run with Elastic Agent again.

@simitt simitt requested a review from a team March 8, 2021 09:37
@apmmachine
Copy link
Collaborator

apmmachine commented Mar 8, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #1076 updated

  • Start Time: 2021-03-08T12:09:46.620+0000

  • Duration: 35 min 56 sec

  • Commit: 5da223d

Test stats 🧪

Test Results
Failed 0
Passed 490
Skipped 1
Total 491

Trends 🧪

Image of Build Times

Image of Tests

@kuisathaverat
Copy link
Contributor

There are a couple of lines too long

[2021-03-08T09:41:51.109Z] scripts/modules/opbeans.py:28:33: W503 line break before binary operator
[2021-03-08T09:41:51.109Z] scripts/modules/elastic_stack.py:705:121: E501 line too long (124 > 120 characters)
[2021-03-08T09:41:51.109Z] scripts/modules/elastic_stack.py:711:121: E501 line too long (124 > 120 characters)

Copy link
Contributor

@jalvz jalvz left a comment

Choose a reason for hiding this comment

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

what about FLEET_URL? wasn't that one required (even if pointing to Kibana)?

"FLEET_ENROLL": "1",
"FLEET_SETUP": "1",
"FLEET_SERVER_POLICY_NAME": "Default policy", # TODO(simitt): make configurable
Copy link
Contributor

Choose a reason for hiding this comment

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

oh, are you sure it is "Default policy" and not "Default"?. i hope this would not be needed anyways

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, it is Default policy; and I already put up elastic/beats#24385 to get rid of this config, but no review yet.

@simitt
Copy link
Contributor Author

simitt commented Mar 8, 2021

what about FLEET_URL? wasn't that one required (even if pointing to Kibana)?

Not required, it is actually only used if FLEET_SERVER_ENABLE is not set (see https://github.com/elastic/beats/pull/24220/files?file-filters%5B%5D=.asciidoc&file-filters%5B%5D=.go#diff-1f8e1e2079524931fa8f3cf121667a25baa2b998557136500d5e7596b46e9187R215)

@simitt
Copy link
Contributor Author

simitt commented Mar 8, 2021

Sorry for the noise on this PR - the make lint command is broken in my env (using the venv from make venv)

@simitt simitt merged commit 75d4892 into elastic:master Mar 8, 2021
v1v added a commit to v1v/apm-integration-testing that referenced this pull request Mar 29, 2021
…rt-from-build

* upstream/master: (24 commits)
  Add mergify (elastic#1089)
  fix: update flake8 and deps to work with Python 3.8+ (elastic#1085)
  chore: bump elastic stack (elastic#1087)
  fix: force to activate venv (elastic#1086)
  fix: --opbeans-node-agent-local-repo=/a/local/dir (elastic#1084)
  ci: jjbb remove periodic-folder-trigger (elastic#1079)
  Fix APM Server managed by Elastic Agent setup (elastic#1078)
  docker/opbeans/go: use -mod=mod (elastic#1077)
  [fleet] fix elastic-agent setup (elastic#1076)
  update supported stack versions (elastic#1075)
  [CI] Increase timeout (elastic#1070)
  Add --package-registry-url flag (elastic#1069)
  Create opbeans_user/role with write/read access for the opbeans-python (elastic#1063)
  reset postgres sequences after database migration (elastic#1062)
  chore: bump Elastic Stack (elastic#1060)
  docker/go/nethttp: go build -mod=mod (elastic#1061)
  check agent liveness via version subcommand (elastic#1059)
  test: use filebeat step to grab Docker logs (elastic#1029)
  Update dotnet sdk 5.0 docker image (elastic#1048)
  docs: using Dyno (elastic#1056)
  ...
@simitt simitt deleted the fix-agent-setup branch April 19, 2021 07:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants