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

[7.17](backport #2064) fix: update stack deployment to follow Users&Roles best practices #2102

Merged
merged 6 commits into from
Feb 8, 2022

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Feb 7, 2022

This is an automatic backport of pull request #2064 done by Mergify.
Cherry-pick of a31f807 has failed:

On branch mergify/bp/7.17/pr-2064
Your branch is up to date with 'origin/7.17'.

You are currently cherry-picking commit a31f8073.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   .ci/.e2e-tests-for-elastic-agent.yaml
	modified:   .ci/.e2e-tests.yaml
	modified:   .ci/Jenkinsfile
	new file:   .ci/ansible/files/sshd_config
	modified:   .ci/ansible/playbook.yml
	modified:   .ci/ansible/requirements.yml
	modified:   .ci/ansible/tasks/install_deps.yml
	modified:   .ci/ansible/tasks/runners.yml
	modified:   .ci/ansible/tasks/setup_test_script.yml
	modified:   cli/config/compose/profiles/fleet/default/kibana.config.yml
	new file:   cli/config/compose/profiles/fleet/elasticsearch-roles.yml
	new file:   cli/config/compose/profiles/fleet/elasticsearch-users
	new file:   cli/config/compose/profiles/fleet/elasticsearch-users_roles
	modified:   cli/config/compose/profiles/fleet/preconfigured-policies/kibana.config.yml
	new file:   cli/config/compose/services/elastic-agent/fleet-server/docker-compose.yml
	modified:   e2e/_suites/fleet/features/apm_integration.feature
	modified:   e2e/_suites/fleet/features/stand_alone_agent.feature
	modified:   e2e/_suites/fleet/fleet.go
	modified:   e2e/_suites/fleet/ingest_manager_test.go
	modified:   e2e/_suites/fleet/stand-alone.go
	modified:   e2e/_suites/fleet/world.go
	modified:   internal/action/process.go
	modified:   internal/deploy/base.go
	modified:   internal/elasticsearch/client.go
	modified:   internal/installer/base.go
	modified:   internal/installer/elasticagent_deb.go
	modified:   internal/installer/elasticagent_docker.go
	modified:   internal/installer/elasticagent_rpm.go
	modified:   internal/installer/elasticagent_tar.go
	modified:   internal/installer/elasticagent_tar_macos.go
	modified:   internal/installer/elasticagent_zip.go
	modified:   internal/kibana/client.go
	modified:   internal/kibana/fleet.go
	modified:   internal/kibana/integrations.go
	modified:   internal/kibana/policies.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   cli/config/compose/profiles/fleet/docker-compose.yml
	both modified:   cli/config/compose/services/elastic-agent/docker-compose.yml
	both modified:   go.mod
	both modified:   go.sum
	both modified:   internal/deploy/base_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

)

* bump stack version 8.1.0-aa69d697

* fix: use new kibana roles and users

We are going to use 'admin' everywhere

* feat: add a method for checking ES cluster health

* fix: create fleet-server after getting a service token from elasticsearch

* fix: start stack using Fleet's test suite code

Instead of calling the compose, we are calling the bootstrapping code for
the Fleet test suite but without any valid tag. Because we are setting
DEVELOPER_MODE=true for the stack node, it will keep the stack even
though the scenarios and tags finished. We also pass a non-existing gherkin
tag, to avoid running any scenario but the bootstrap code, only.

* fix: typo

* fix: selective execution of the .env for fleet suite

* chore: try 'not in'

* chore: use AND conditionals as a list

* fix: check for stckRunner to be defined

* fix: pass stackRunner var to the stack creation

* fix: check for suite is defined first

* fix: check for suite var

* chore: use multiline for when condirtionals

* fix docker install

Signed-off-by: Adam Stokes <[email protected]>

* fix suite definition for autodiscover

Signed-off-by: Adam Stokes <[email protected]>

* add kubectl to path

Signed-off-by: Adam Stokes <[email protected]>

* chore: bump elastic-agent versions to 8.1.hashed snapshot

* fix: use docker provider for APM integration

It will run on Debian AMD/ARM and SLES15

* chore: add client alive SSH settings

* Revert "chore: add client alive SSH settings"

This reverts commit 306551c.

* chore: define SSHD server settings for runners

* chore: skip ubi8 scenarios

We need to adapt them to the dnew deployment model. See #2088

* fix: transform response from bytes to string

* fix: properly read Input Streams and Vars

* fix: expose port for 0.0.0.0

* fix: streams could go empty

* fix: expose port for 0.0.0.0

* fix: support checking for process count in containers

* chore: unskip apm-server on ubi8

* chore: always install docker on runners

* chore: bump elastic-package to v0.36.0

* chore: use elastic-package for apm-server scenarios

* chore: use elastic-package for apm-server scenarios

* Revert "chore: use elastic-package for apm-server scenarios"

This reverts commit b5896a8.

* Revert "chore: use elastic-package for apm-server scenarios"

This reverts commit c6c29ac.

* chore: run dockerised tests only on debian

* chore: do not print out tar extract command

* fix: keep a Docker deployer for docker-based tests

* fix: install docker for ARM

* fix: remove invalid role vars for ARM

* fix: install python-pip on ARM first

* fix: install docker on ARM properly

See https://www.docker.com/blog/getting-started-with-docker-for-arm-on-linux/

* fix: install docker on Suse

* fix: typo

Co-authored-by: Noémi Ványi <[email protected]>

* Fix error checking for revoked enroll token

Signed-off-by: Adam Stokes <[email protected]>

* fix logging

Signed-off-by: Adam Stokes <[email protected]>

* chore: use empty streams if error

* fix: pass fleet-server policy to fleet-server on bootstrap

* fix: retrieve default fleet-server policy instead of creating a new one

* chore: restart services with restart command

Instead of calling stop & start right after it, we are leveraging services
ability to be restarted. For linux, systemctl will use "restart", for MacOS
it will use "stop and start", for Windows, it's not supported yet

* chore: increase expire timeout of the service token to the max (1h)

Co-authored-by: apmmachine <[email protected]>
Co-authored-by: Adam Stokes <[email protected]>
Co-authored-by: Noémi Ványi <[email protected]>
(cherry picked from commit a31f807)

# Conflicts:
#	cli/config/compose/profiles/fleet/docker-compose.yml
#	cli/config/compose/services/elastic-agent/docker-compose.yml
#	go.mod
#	go.sum
#	internal/deploy/base_test.go
@mergify mergify bot added the conflicts There is a conflict in the backported pull request label Feb 7, 2022
@elasticmachine
Copy link
Contributor

elasticmachine commented Feb 7, 2022

🤖 GitHub comments

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

  • /test : Re-trigger the build.

@mdelapenya mdelapenya removed the conflicts There is a conflict in the backported pull request label Feb 8, 2022
@mdelapenya
Copy link
Contributor

Merging to solve the Ansible deployment issues. Will create separate issues if any other problem occurs

@mdelapenya mdelapenya merged commit bf78c15 into 7.17 Feb 8, 2022
@mergify mergify bot deleted the mergify/bp/7.17/pr-2064 branch February 8, 2022 16:45
@mdelapenya mdelapenya mentioned this pull request Feb 9, 2022
8 tasks
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.

2 participants