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

🌱 E2E tests for self-hosted upgrades #4671

Closed

Conversation

tcordeu
Copy link
Contributor

@tcordeu tcordeu commented May 25, 2021

What this PR does / why we need it:
Add E2E tests:

  • Upgrade a single control plane, self-hosted cluster.
  • Upgrade an HA control plane, self-hosted cluster.

Which issue(s) this PR fixes
Fixes #3728

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign neolit123 after the PR has been reviewed.
You can assign the PR to them by writing /assign @neolit123 in a comment when ready.

The full list of commands accepted by this bot can be found 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
Copy link
Contributor

Hi @tcordeu. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 25, 2021
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 25, 2021
@tcordeu
Copy link
Contributor Author

tcordeu commented May 25, 2021

Even tough the tests seem to be running fine I am seeing logs like this when testing the upgrades:

INFO: Waiting for etcd to have the upgraded image tag
INFO: Got error while streaming logs for pod capi-kubeadm-bootstrap-system/capi-kubeadm-bootstrap-controller-manager-b46d954bc-dhqj4, container manager: http2: server sent GOAWAY and closed the connection; LastStreamID=24623, ErrCode=NO_ERROR, debug=""
INFO: Got error while streaming logs for pod capd-system/capd-controller-manager-845bbfdf7d-wpdnb, container manager: http2: server sent GOAWAY and closed the connection; LastStreamID=24623, ErrCode=NO_ERROR, debug=""
INFO: Got error while streaming logs for pod capd-system/capd-controller-manager-845bbfdf7d-wpdnb, container kube-rbac-proxy: http2: server sent GOAWAY and closed the connection; LastStreamID=24623, ErrCode=NO_ERROR, debug=""
INFO: Got error while streaming logs for pod capi-kubeadm-control-plane-system/capi-kubeadm-control-plane-controller-manager-6b54c76ff9-rt7l8, container kube-rbac-proxy: http2: server sent GOAWAY and closed the connection; LastStreamID=24623, ErrCode=NO_ERROR, debug=""
INFO: Got error while streaming logs for pod capi-system/capi-controller-manager-7c6fc9fcbf-4tp7c, container kube-rbac-proxy: http2: server sent GOAWAY and closed the connection; LastStreamID=24623, ErrCode=NO_ERROR, debug=""
INFO: Got error while streaming logs for pod capi-system/capi-controller-manager-7c6fc9fcbf-4tp7c, container manager: http2: server sent GOAWAY and closed the connection; LastStreamID=24623, ErrCode=NO_ERROR, debug=""
INFO: Got error while streaming logs for pod capi-kubeadm-bootstrap-system/capi-kubeadm-bootstrap-controller-manager-b46d954bc-dhqj4, container kube-rbac-proxy: http2: server sent GOAWAY and closed the connection; LastStreamID=24623, ErrCode=NO_ERROR, debug=""
STEP: PASSED!

@fabriziopandini, do you have any idea as to why this is happening?

@tcordeu tcordeu force-pushed the e2e_self_hosted_upgrades branch from 56803d6 to 70b2a08 Compare May 27, 2021 01:59
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@tcordeu changes looks fine, however, having in mind #4672, I'm wondering if we should change a little bit approach and have two test suites instead of having two test specs inside the same suite.

In practice, we need to change test/e2e/self_hosted_test.go in order to have

var _ = Describe("When testing Cluster API working on single control plane self-hosted clusters", func() {
	SelfHostedSpec(context.TODO(), func() SelfHostedSpecInput {
		return SelfHostedSpecInput{
			...
			ControlPlaneMachineCount: 1,
		}
	})
})

var _ = Describe("When testing Cluster API working on HA self-hosted clusters", func() {
	SelfHostedSpec(context.TODO(), func() SelfHostedSpecInput {
		return SelfHostedSpecInput{
			...
			ControlPlaneMachineCount: 3,
		}
	})
})

And make the new field SelfHostedSpecInput.ControlPlaneMachineCount to flow down to ApplyClusterTemplateAndWait (Last but not least, we should revert back to having a single It statement inside SelfHostedSpec)
wdyt?

@fabriziopandini
Copy link
Member

INFO: Got error while streaming logs for pod capi-kubeadm-bootstrap-system/capi-kubeadm-bootstrap-controller-manager-b46d954bc-dhqj4, container manager: http2: server sent GOAWAY and closed the connection; LastStreamID=24623, ErrCode=NO_ERROR, debug=""

@fabriziopandini, do you have any idea as to why this is happening?

I assume the error happens because when we install providers, we start a go routine that streams logs from the pods hosting our controllers; however, if those pods gets destroyed/re-created to another machine (like during an upgrade), the streaming code in the go routine fails.
I don't have a clear idea on how to fix it, I will open an issue to track this

@tcordeu
Copy link
Contributor Author

tcordeu commented May 27, 2021

@tcordeu changes looks fine, however, having in mind #4672, I'm wondering if we should change a little bit approach and have two test suites instead of having two test specs inside the same suite.

In practice, we need to change test/e2e/self_hosted_test.go in order to have

var _ = Describe("When testing Cluster API working on single control plane self-hosted clusters", func() {
	SelfHostedSpec(context.TODO(), func() SelfHostedSpecInput {
		return SelfHostedSpecInput{
			...
			ControlPlaneMachineCount: 1,
		}
	})
})

var _ = Describe("When testing Cluster API working on HA self-hosted clusters", func() {
	SelfHostedSpec(context.TODO(), func() SelfHostedSpecInput {
		return SelfHostedSpecInput{
			...
			ControlPlaneMachineCount: 3,
		}
	})
})

And make the new field SelfHostedSpecInput.ControlPlaneMachineCount to flow down to ApplyClusterTemplateAndWait (Last but not least, we should revert back to having a single It statement inside SelfHostedSpec)
wdyt?

Seems like a good idea considering #4672, I will change it!

@tcordeu tcordeu force-pushed the e2e_self_hosted_upgrades branch from 70b2a08 to 5010a23 Compare May 27, 2021 17:39
@tcordeu
Copy link
Contributor Author

tcordeu commented May 27, 2021

@fabriziopandini I implemented the changes you proposed, please give it a look when you're free!

@tcordeu tcordeu requested a review from fabriziopandini May 27, 2021 17:39
@fabriziopandini
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 27, 2021
@fabriziopandini
Copy link
Member

/lgtm
/test pull-cluster-api-e2e-full-main
To force the test to run

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 27, 2021
@fabriziopandini
Copy link
Member

@tcordeu the test is failing
FYI we just updated instructions on how to run/debug E2E tests locally, see https://master.cluster-api.sigs.k8s.io/developer/testing.html#running-the-end-to-end-tests-locally

@tcordeu
Copy link
Contributor Author

tcordeu commented May 31, 2021

Upon further review KubernetesVersion and KubernetesVersionUpgradeTo have the same value (v1.19.11), so the update was not doing much... (even tough the original error seems to be etcd taking too long to update).
@fabriziopandini I have two ideas:

What do you think?

@fabriziopandini
Copy link
Member

fabriziopandini commented Jun 1, 2021

@tcordeu god catch.
Being this now an upgrade test, it should use KUBERNETES_VERSION_UPGRADE_FROM (instead of KUBERNETES_VERSION) and KUBERNETES_VERSION_UPGRADE_TO

@CecileRobertMichon
Copy link
Contributor

/lgtm cancel

@k8s-ci-robot
Copy link
Contributor

@tcordeu: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jun 3, 2021
@@ -24,16 +24,28 @@ import (
. "github.com/onsi/ginkgo"
)

var _ = Describe("When testing Cluster API working on self-hosted clusters", func() {

var _ = Describe("When testing Cluster API working on single control plane self-hosted clusters", func() {
SelfHostedSpec(context.TODO(), func() SelfHostedSpecInput {
Copy link
Member

Choose a reason for hiding this comment

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

Lets use the global contest introduced by #4706 instead of context.TODO

@fabriziopandini
Copy link
Member

@tcordeu do you have time to rebase this PR?

@k8s-ci-robot
Copy link
Contributor

@tcordeu: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-e2e-full-main 5010a23 link /test pull-cluster-api-e2e-full-main
pull-cluster-api-test-main-mink8s 5010a23 link /test pull-cluster-api-test-main-mink8s
pull-cluster-api-verify-main 5010a23 link true /test pull-cluster-api-verify-main
pull-cluster-api-test-mink8s-main 5010a23 link true /test pull-cluster-api-test-mink8s-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@fabriziopandini
Copy link
Member

/close
due to inactivity

@k8s-ci-robot
Copy link
Contributor

@fabriziopandini: Closed this PR.

In response to this:

/close
due to inactivity

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implements test for self-hosted upgrades
4 participants