-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Cherry-pick #17656 to 7.x: Run kubernetes integration tests inside of a pod and use kind to setup a kubernetes cluster #18111
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)
Pinging @elastic/integrations-platforms (Team:Platforms) |
💔 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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a quick look it LGTM, once merged I will also backport #18125.
Cherry-pick of PR #17656 to 7.x branch. Original message:
What does this PR do?
Refactors how
mage goIntegTest
run 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 thekubernetes
module 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.yml
file then it will run in docker, if the module has akubernetes.yml
then 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
KUBECONFIG
is 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
KubeRemote
which 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-rsync
and the test executer container that starts once init container exits. The init container exits after the first SSH connection is made and disconnects.rsync
is ran locally to sync the beats repo to the init container sync directory which was mounted as anemptyDir
and 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.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Related issues