Skip to content

Add how-to for testing elastic-agent on k8s#28697

Merged
tetianakravchenko merged 3 commits intoelastic:masterfrom
tetianakravchenko:elastic-agent-local-dev
Dec 1, 2021
Merged

Add how-to for testing elastic-agent on k8s#28697
tetianakravchenko merged 3 commits intoelastic:masterfrom
tetianakravchenko:elastic-agent-local-dev

Conversation

@tetianakravchenko
Copy link
Copy Markdown
Contributor

Signed-off-by: Tetiana Kravchenko tetiana.kravchenko@elastic.co

What does this PR do?

This PR adds instructions on how to test elastic agent on Kubernetes locally.

Why is it important?

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 28, 2021
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Oct 28, 2021

This pull request does not have a backport label. Could you fix it @tetianakravchenko? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Oct 28, 2021
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Oct 28, 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 preview

Expand to view the summary

Build stats

  • Start Time: 2021-11-11T17:40:14.395+0000

  • Duration: 22 min 48 sec

  • Commit: 5b386cd

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Copy Markdown
Member

@ChrsMark ChrsMark left a comment

Choose a reason for hiding this comment

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

Thank you for adding this! Looks good over and the place for this should be just fine, I left some minors.


#### Prerequisites
- create kubernetes cluster using kind, check [here](https://github.com/elastic/beats/blob/master/metricbeat/module/kubernetes/_meta/test/docs/README.md) for details
- deploy kube-state-metrics
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A link to the page-manifests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

4f18959
this is a link to the metricbeat Readme to not repeat the same steps multiple times, maybe it could be moved to "common" how-to later

#### Prerequisites
- create kubernetes cluster using kind, check [here](https://github.com/elastic/beats/blob/master/metricbeat/module/kubernetes/_meta/test/docs/README.md) for details
- deploy kube-state-metrics
- deploy ELK stack or use [elastic cloud](https://cloud.elastic.co), check [here](https://github.com/elastic/beats/blob/master/metricbeat/module/kubernetes/_meta/test/docs/README.md) for details
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well it depends on if we what standalone or managed mode. With standalone we only need an ES running and it can be on cloud or locally (on same k8s cluster). With managed mode though is not so easy to have a local setup which would mean that we would have ES+Kibana+FleetServer+Registry running locally. At the moment I'm not so sure how easy it is but for sure we don't have a ready to use example for this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've seen k8s manifests for ES+Kibana+FleetServer+Registry here -
https://github.com/elastic/e2e-testing/tree/master/cli/config/kubernetes/base, might be smth to check later

- download all-in-ome manifest:
```
ELASTIC_AGENT_VERSION="8.0"
curl -L -O https://raw.githubusercontent.com/elastic/beats/${ELASTIC_AGENT_VERSION}/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, so it looks like we focus on standalone mode only. It's just fine if we mention it in the tittle of this section :).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

renamed 4f18959

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why should it be specific for standalone or managed? We can provide both options. The most important is to mention the update in the image name and imagePullPolicy. For the env variables I believe it is not in the scope of these instructions as we don't know which way the user has deployed the stack (elastic package or cloud or something else). A mention to which env vars to update depending if it is standalone or managed would be adequate I believe. @ChrsMark, @tetianakravchenko what do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@MichaelKatsoulis sorry, I somehow missed your question. Initially I've tried to run this locally (local ES+Kibana) with standalone elastic-agent as I was not sure how to run it locally in managed mode. I see your point and will adjust instructions to make them more generic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ChrsMark @MichaelKatsoulis could you please give another look to this PR?

…e mode on Kubernetes'

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
@jsoriano jsoriano added the Team:Integrations Label for the Integrations team label Oct 29, 2021
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/integrations (Team:Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Oct 29, 2021
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
@tetianakravchenko tetianakravchenko merged commit e0bb4b8 into elastic:master Dec 1, 2021
@tetianakravchenko tetianakravchenko deleted the elastic-agent-local-dev branch December 1, 2021 09:45
v1v added a commit that referenced this pull request Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-skip Skip notification from the automated backport with mergify Team:Integrations Label for the Integrations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants