Cherry-pick #17656 to 7.x: Run kubernetes integration tests inside of a pod and use kind to setup a kubernetes cluster#18111
Merged
blakerouse merged 2 commits intoelastic:7.xfrom Apr 30, 2020
Conversation
…p a kubernetes cluster (elastic#17656) * Use kind to bring up a local kubernetes cluster and then run the integration tests against the kind cluster. * Run mage update. * Add more tests. * Fix more tests, install kind in prepare-tests. * Switch to running kubernetes integration tests inside of Kubernetes. * Use golang 1.13.9. * Fix for other beats. * Run mage fmt. * Don't run kubernetes integration tests if not inside kubernetes environment. * Fix metricbeat to use mage and the makefile shim for mage. * Improve the error message when kind or kubectl is not available. * Refactor the integration tests into a more module system. * Fix go vet. * Setup travis to use kind. * Run kubernetes integration tests in Jenkins. * Fix filebeat magefile. * Fix travis and Jenkins. * Check requirements of the test runner before actually running the tests. * Add return on parsebool error. * Don't return err on missing requirements for tester. * Run make update. * Move the kubernetes items to its own module, import that module only by metricbeat. (cherry picked from commit db29874)
Contributor
|
Pinging @elastic/integrations-platforms (Team:Platforms) |
Contributor
💔 Build FailedExpand to view the summary
Build stats
Test stats 🧪
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #17656 to 7.x branch. Original message:
What does this PR do?
Refactors how
mage goIntegTestrun for metricbeat. Before each module was run inside of a docker container usingdocker-compose. Now depending on the module it will either run in docker or kubernetes. At the moment only thekubernetesmodule runs inside of kubernetes.Each module is determined if it should run inside of docker or inside of kubernetes. If the module has a
docker-compose.ymlfile then it will run in docker, if the module has akubernetes.ymlthen it will run inside of kubernetes.The docker runner stuff is the same so nothing really changes there, but the kubernetes runner is what is new. It works by executing the tests inside of a Pod running inside of the kubernetes.
If
KUBECONFIGis defined in the environment then the runner just executes the tests against that defined kubernetes. If its not defined then kind will be used to setup a cluster and run the tests against that cluster.Running the tests inside of kubernetes is handled by
KubeRemotewhich uses the kubernetes client-go to setup all the requirements to get it running. Below breaks down the steps that are taken to get it running:sshd-rsyncand the test executer container that starts once init container exits. The init container exits after the first SSH connection is made and disconnects.rsyncis ran locally to sync the beats repo to the init container sync directory which was mounted as anemptyDirand shared between the init container and exec container.kubernetes.Why is it important?
Currently all of the Kubernetes integration tests are skipped, this fixes them so they can actually be ran inside of a real Kubernetes cluster.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Author's Checklist
How to test this PR locally
Related issues