-
Notifications
You must be signed in to change notification settings - Fork 748
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
Cover bottlerocket cluster test. #1096
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2f4a3df
Attempt first bottlerocket test.
bnapolitan 05b5136
Increase no output timeout.
bnapolitan ccf0a16
Fix up test cluster.
bnapolitan db36382
Merge branch 'upstream-master' into bottlerocket-test
bnapolitan 821067f
Attempt bottlerocket test with proper configs.
bnapolitan d82b0de
Retry bottlerocket with kubeconfig.
bnapolitan 57089ad
Delete cluster on fail.
bnapolitan 61ede1c
Remove erroneous 'fi'.
bnapolitan 56a9817
Move into ensure_eksctl, remove extra flag set.
bnapolitan 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ ARCH=$(go env GOARCH) | |
: "${BUILD:=true}" | ||
: "${RUN_CONFORMANCE:=false}" | ||
: "${RUN_KOPS_TEST:=false}" | ||
: "${RUN_BOTTLEROCKET_TEST:=false}" | ||
|
||
__cluster_created=0 | ||
__cluster_deprovisioned=0 | ||
|
@@ -29,13 +30,15 @@ on_error() { | |
# Make sure we destroy any cluster that was created if we hit run into an | ||
# error when attempting to run tests against the cluster | ||
if [[ $__cluster_created -eq 1 && $__cluster_deprovisioned -eq 0 && "$DEPROVISION" == true ]]; then | ||
echo "Cluster was provisioned already. Deprovisioning it..." | ||
__cluster_deprovisioned=1 | ||
if [[ $RUN_KOPS_TEST == true ]]; then | ||
__cluster_deprovisioned=1 | ||
echo "Cluster was provisioned already. Deprovisioning it..." | ||
down-kops-cluster | ||
elif [[ $RUN_BOTTLEROCKET_TEST == true ]]; then | ||
eksctl delete cluster bottlerocket | ||
else | ||
# prevent double-deprovisioning with ctrl-c during deprovisioning... | ||
__cluster_deprovisioned=1 | ||
echo "Cluster was provisioned already. Deprovisioning it..." | ||
down-test-cluster | ||
fi | ||
|
@@ -151,10 +154,18 @@ mkdir -p "$TEST_CLUSTER_DIR" | |
mkdir -p "$TEST_CONFIG_DIR" | ||
|
||
START=$SECONDS | ||
if [[ "$PROVISION" == true && "$RUN_KOPS_TEST" == true ]]; then | ||
up-kops-cluster | ||
elif [[ "$PROVISION" == true ]]; then | ||
up-test-cluster | ||
if [[ "$PROVISION" == true ]]; then | ||
START=$SECONDS | ||
if [[ "$RUN_BOTTLEROCKET_TEST" == true ]]; then | ||
ensure_eksctl | ||
eksctl create cluster --config-file ./testdata/bottlerocket.yaml | ||
elif [[ "$RUN_KOPS_TEST" == true ]]; then | ||
up-kops-cluster | ||
else | ||
up-test-cluster | ||
fi | ||
UP_CLUSTER_DURATION=$((SECONDS - START)) | ||
echo "TIMELINE: Upping test cluster took $UP_CLUSTER_DURATION seconds." | ||
fi | ||
__cluster_created=1 | ||
|
||
|
@@ -170,11 +181,15 @@ sed -i'.bak' "s,:$MANIFEST_IMAGE_VERSION,:$TEST_IMAGE_VERSION," "$TEST_CONFIG_PA | |
sed -i'.bak' "s,602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni-init,$INIT_IMAGE_NAME," "$TEST_CONFIG_PATH" | ||
sed -i'.bak' "s,:$MANIFEST_IMAGE_VERSION,:$TEST_IMAGE_VERSION," "$TEST_CONFIG_PATH" | ||
|
||
if [[ $RUN_KOPS_TEST != true ]]; then | ||
export KUBECONFIG=$KUBECONFIG_PATH | ||
if [[ $RUN_KOPS_TEST == true || $RUN_BOTTLEROCKET_TEST == true ]]; then | ||
KUBECTL_PATH=kubectl | ||
export KUBECONFIG=~/.kube/config | ||
Comment on lines
+184
to
+186
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, so both Kops and eksctl needs these to be set. |
||
else | ||
export KUBECONFIG=$KUBECONFIG_PATH | ||
fi | ||
|
||
if [[ $RUN_KOPS_TEST == true ]]; then | ||
run_kops_conformance | ||
KUBECTL_PATH=kubectl | ||
fi | ||
ADDONS_CNI_IMAGE=$($KUBECTL_PATH describe daemonset aws-node -n kube-system | grep Image | cut -d ":" -f 2-3 | tr -d '[:space:]') | ||
|
||
|
@@ -239,6 +254,8 @@ if [[ "$DEPROVISION" == true ]]; then | |
|
||
if [[ "$RUN_KOPS_TEST" == true ]]; then | ||
down-kops-cluster | ||
elif [[ "$RUN_BOTTLEROCKET_TEST" == true ]]; then | ||
eksctl delete cluster bottlerocket | ||
else | ||
down-test-cluster | ||
fi | ||
|
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,23 @@ | ||
--- | ||
apiVersion: eksctl.io/v1alpha5 | ||
kind: ClusterConfig | ||
|
||
metadata: | ||
name: bottlerocket | ||
region: us-west-2 | ||
version: '1.15' | ||
|
||
nodeGroups: | ||
- name: ng-bottlerocket | ||
instanceType: m5.large | ||
desiredCapacity: 4 | ||
amiFamily: Bottlerocket | ||
iam: | ||
attachPolicyARNs: | ||
- arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy | ||
- arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy | ||
- arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly | ||
- arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore | ||
bottlerocket: | ||
settings: | ||
motd: "Hello from eksctl!" |
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.
Oh, it's that slow?
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.
eksctl can sometimes take longer than 15m to create the cluster and mng, so it did timeout once. Haven't seen any problems after moving it to 20m!