-
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
Run kubernetes integration tests inside of a pod and use kind to setup a kubernetes cluster #17656
Merged
blakerouse
merged 22 commits into
elastic:master
from
blakerouse:k8s-integration-use-kind
Apr 29, 2020
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
fe4f8b2
Use kind to bring up a local kubernetes cluster and then run the inte…
blakerouse 59f8c95
Run mage update.
blakerouse 39ad334
Add more tests.
blakerouse c529a0e
Fix more tests, install kind in prepare-tests.
blakerouse 89f8364
Switch to running kubernetes integration tests inside of Kubernetes.
blakerouse a3ef81a
Use golang 1.13.9.
blakerouse 4b284a5
Fix for other beats.
blakerouse 1460711
Run mage fmt.
blakerouse cea2b4b
Don't run kubernetes integration tests if not inside kubernetes envir…
blakerouse 3f193a1
Fix metricbeat to use mage and the makefile shim for mage.
blakerouse fa1ef81
Improve the error message when kind or kubectl is not available.
blakerouse 4b766ae
Refactor the integration tests into a more module system.
blakerouse 80b5b34
Fix go vet.
blakerouse 53e514d
Setup travis to use kind.
blakerouse 17137ca
Run kubernetes integration tests in Jenkins.
blakerouse bcfe456
Fix filebeat magefile.
blakerouse 85ed3c3
Fix travis and Jenkins.
blakerouse 539e3b2
Check requirements of the test runner before actually running the tests.
blakerouse 92fcb56
Add return on parsebool error.
blakerouse fbea221
Don't return err on missing requirements for tester.
blakerouse 431afe2
Run make update.
blakerouse 2f42f18
Move the kubernetes items to its own module, import that module only …
blakerouse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
set -exuo pipefail | ||
|
||
MSG="parameter missing." | ||
DEFAULT_HOME="/usr/local" | ||
KIND_VERSION=${KIND_VERSION:?$MSG} | ||
HOME=${HOME:?$DEFAULT_HOME} | ||
KIND_CMD="${HOME}/bin/kind" | ||
|
||
mkdir -p "${HOME}/bin" | ||
|
||
curl -sSLo "${KIND_CMD}" "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64" | ||
chmod +x "${KIND_CMD}" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
set -exuo pipefail | ||
|
||
MSG="parameter missing." | ||
DEFAULT_HOME="/usr/local" | ||
K8S_VERSION=${K8S_VERSION:?$MSG} | ||
HOME=${HOME:?$DEFAULT_HOME} | ||
KUBECTL_CMD="${HOME}/bin/kubectl" | ||
|
||
mkdir -p "${HOME}/bin" | ||
|
||
curl -sSLo "${KUBECTL_CMD}" "https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl" | ||
chmod +x "${KUBECTL_CMD}" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,5 @@ | ||
#!/usr/bin/env bash | ||
set -exuo pipefail | ||
|
||
MSG="parameter missing." | ||
K8S_VERSION=${K8S_VERSION:?$MSG} | ||
HOME=${HOME:?$MSG} | ||
KBC_CMD="${HOME}/bin/kubectl" | ||
|
||
mkdir -p "${HOME}/bin" | ||
|
||
curl -sSLo "${KBC_CMD}" "https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl" | ||
chmod +x "${KBC_CMD}" | ||
|
||
GO111MODULE="on" go get sigs.k8s.io/kind@v0.5.1 | ||
kind create cluster --image kindest/node:${K8S_VERSION} | ||
|
||
export KUBECONFIG="$(kind get kubeconfig-path)" | ||
kubectl cluster-info |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Use
mage
instead?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.
Used make because the PWD is the root of beats, so using make allows the
make -C metricbeat
to easily go into that directory.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.
mage -d
works likemake -C
.