Skip to content

Conversation

jweite-amazon
Copy link
Contributor

Issue #, if available:

Description of changes:
Changes to E2E affinity tests to support true affinity testing if ACS env has three or more hosts in the zone being used for the test. If fewer than three hosts are available, falls back to the pre-existing one-VM test, which only verifies that the VM is placed in the appropriate affinity group.

Testing performed:
Executed test in single host and 3-host environments, observing it allocating the one or three VMs respectively for the CP and workers. Tests pass in both cases.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…n number of available hosts. Added alternate e2e config file for 10.11.0.2.
… param, allowing override of the default test/e2e/config/cloudstack.yaml.
@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 30, 2022
@netlify
Copy link

netlify bot commented Nov 30, 2022

Deploy Preview for kubernetes-sigs-cluster-api-cloudstack ready!

Name Link
🔨 Latest commit 0a65aaa
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-cloudstack/deploys/63920df7047fd200087d6fc9
😎 Deploy Preview https://deploy-preview-196--kubernetes-sigs-cluster-api-cloudstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 30, 2022
@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 Nov 30, 2022
@jweite-amazon jweite-amazon requested review from mrog and wongni November 30, 2022 01:12
ph.SetResourcestate("Enabled")
ph.SetState("Up")
listHostsResponse, err := client.Host.ListHosts(ph)
Expect(err).To(BeNil(), "error listing hosts")
Copy link
Contributor

Choose a reason for hiding this comment

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

do the contents of err get logged here? That'd be useful for troubleshooting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes:
error listing zones Expected <*errors.errorString | 0xc00154abe0>: { s: "CloudStack API error 401 (CSExceptionErrorCode: 0): unable to verify user credentials and/or request signature", } to be nil

@@ -79,6 +79,17 @@ func AffinityGroupSpec(ctx context.Context, inputGetter func() CommonSpecInput)
}

func executeTest(ctx context.Context, input CommonSpecInput, namespace *corev1.Namespace, specName string, clusterResources *clusterctl.ApplyClusterTemplateAndWaitResult, affinityType string) []string {
csClient := CreateCloudStackClient(ctx, input.BootstrapClusterProxy.GetKubeconfigPath())
zoneName := input.E2EConfig.GetVariable("CLOUDSTACK_ZONE_NAME")
Copy link
Contributor

Choose a reason for hiding this comment

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

is only one zone supported? Can users not pass in a config with multiple zones?

Copy link
Contributor Author

@jweite-amazon jweite-amazon Nov 30, 2022

Choose a reason for hiding this comment

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

Yes, as of today there's only a single-valued CLOUDSTACK_ZONE_NAME param defined in the config, and referenced in the cluster templates. None of the test scenarios/cluster templates so far define more than a single failure domain. Supporting multiple zones in multiple FDs would require some changes.

… secret format. Removed redundant int64 cast. Clarified error message if wrong number of zones for a name found.
if numHosts < 3 {
// If not enough ACS hosts to support 3 machines with anti-affinity, fall back to just allocating one machine.
// Test will only confirm that the single VM is in an anti-affinity group, but not that ACS anti-affinty works.
By("Fewer than three host in ACS env. Only verifying that a single VM gets placed in an AG, not that true affinity/anti-affinity is ultimately achieved.")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should explicitly skip this test if there are <3 hosts. This way is very subtle and tests some plumbing code but not the full vertical feature. If we skip the test with a message explaining why, then the user knows they should address it in their environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. That makes the most sense. Thanks for that Max.

@jweite-amazon jweite-amazon marked this pull request as ready for review December 8, 2022 14:59
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 8, 2022
@k8s-ci-robot k8s-ci-robot requested a review from maxdrib December 8, 2022 14:59
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jweite-amazon, maxdrib

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:
  • OWNERS [jweite-amazon,maxdrib]

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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 8, 2022
@jweite-amazon jweite-amazon merged commit cb4c81b into kubernetes-sigs:main Dec 8, 2022
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. 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.

3 participants