Skip to content
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

Add eksctl support to e2e scripts #852

Merged
merged 3 commits into from
Apr 29, 2021
Merged

Conversation

wongma7
Copy link
Contributor

@wongma7 wongma7 commented Apr 26, 2021

Is this a bug fix or adding new feature? testing

What is this PR about? / Why do we need it? Would like to test the driver on eks in addition to kops. eksctl command is similar enough to kops that I think the easiest way is to add a short eksctl script (eksctl.sh) like kops.sh

implementation detail differences:

  • eksctl doesn't have an equivalent to 'kops export kubecfg' to export kubeconfig and (re) set the current-context to the test cluster. I refactored the scripts such that they export kubeconfig to a file in the test dir instead of .kube/config so that it's easier to keep track of them and to avoid polluting .kube/config
  • I haven't figured out yet how to patch eksctl clujster config to add node iam policies, I think first I will add an eks prow job and then work on adding it in a future PR.
  • K8S_VERSION must be x.y for eksctl not x.y.z as for kops.
  • eksctl doesn't have an equivalent to kops update --yes. for kops, first you update the state file in s3 then run update --yes to actually update the cluster resources, eksctl it happens at once, there is no state file?

What testing is done?
tested locally:

$ TEST_ID=88888 \
                                              CLEAN=true \
                                              CLUSTER_TYPE=eksctl \
                                              GINKGO_NODES=1 \
                                              AWS_REGION=us-west-2 \
                                              AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b,us-west-2c \
                                              TEST_PATH=./tests/e2e-kubernetes/... \
                                              GINKGO_FOCUS="asdf" \
                                              K8S_VERSION="1.19" \
                                              ./hack/e2e/run.sh
...
2021-04-26 12:52:35 [ℹ]  will delete stack "eksctl-test-cluster-88888-k8s-local-cluster"
2021-04-26 12:52:35 [✔]  all cluster resources were deleted
###
## OVERALL_TEST_PASSED: 0
#
###
## SUCCESS!
#

Will let CI test that i haven't broken the existing kops job. Will add an eks prow job later and then work on fixing it in future PR.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 26, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wongma7

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 26, 2021
@wongma7 wongma7 requested review from nckturner, ayberk and AndyXiangLi and removed request for leakingtapan and AndyXiangLi April 26, 2021 20:02
@@ -57,26 +52,27 @@ function kops_create_cluster() {
kops_patch_cluster_file "$CLUSTER_FILE" "$KOPS_PATCH_FILE"

loudecho "Creating cluster $CLUSTER_NAME with $CLUSTER_FILE"
${KOPS_BIN} create --state "${KOPS_STATE_FILE}" -f "${CLUSTER_FILE}"
${BIN} create --state "${KOPS_STATE_FILE}" -f "${CLUSTER_FILE}"
kops create secret --state "${KOPS_STATE_FILE}" --name "${CLUSTER_NAME}" sshpublickey admin -i "${SSH_KEY_PATH}".pub
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unrelated change, cuz I found out while testing "kops update cluster --state "${KOPS_STATE_FILE}" "${CLUSTER_NAME}"
--ssh-public-key="${SSH_KEY_PATH}".pub --yes" is deprecated:

--ssh-public-key string SSH public key to use (deprecated: use kops create secret instead)

@coveralls
Copy link

coveralls commented Apr 26, 2021

Pull Request Test Coverage Report for Build 1932

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 17 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.06%) to 79.188%

Files with Coverage Reduction New Missed Lines %
pkg/cloud/metadata.go 17 83.48%
Totals Coverage Status
Change from base Build 1890: -0.06%
Covered Lines: 1990
Relevant Lines: 2513

💛 - Coveralls

Copy link

@nckturner nckturner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, some small comments.

hack/e2e/run.sh Show resolved Hide resolved
hack/e2e/eksctl.sh Outdated Show resolved Hide resolved
hack/e2e/eksctl.sh Outdated Show resolved Hide resolved
@nckturner
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 29, 2021
@wongma7
Copy link
Contributor Author

wongma7 commented Apr 29, 2021

coveralls bugged (did not touc hgo code), manual merge

@wongma7 wongma7 merged commit 1923417 into kubernetes-sigs:master Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants