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 service connectivity test #1436

Merged
merged 1 commit into from
Apr 23, 2021
Merged

Conversation

abhipth
Copy link
Contributor

@abhipth abhipth commented Apr 22, 2021

What type of PR is this?
Integration test

Which issue does this PR fix:
Adds test for verifying connectivity to pods behind service in the following modes

  • NBL using in tree service controller
  • CLB using in tree service controller
  • NodePort
  • ClusterIP

What does this PR do / Why do we need it:
Integration testing

If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:

Testing done on this change:
NA

Automation added to e2e:
NA

Will this break upgrades or downgrades. Has updating a running cluster been tested?:
NA

Does this change require updates to the CNI daemonset config files to work?:
NA

Does this PR introduce any user-facing change?:
NA

Output

• [SLOW TEST:113.438 seconds]
test service connectivity
/Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:37
  when a deployment behind clb service is created
  /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:142
    clb service pod should be reachable
    /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:147
------------------------------
test service connectivity when a deployment behind nlb service is created 
  nlb service pod should be reachable
  /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:157
STEP: creating and waiting for deployment to be ready
STEP: creating the service of type LoadBalancer
created service
: {LoadBalancer:{Ingress:[{IP: Hostname:a47ba1601cd2c49a885ab5ffb0700143-3ca5fe6a84bcb6d8.elb.us-west-2.amazonaws.com}]}}
STEP: sleeping for some time to allow service to become ready
STEP: creating jobs to verify service connectivity
STEP: creating negative jobs to verify service connectivity fails for unreachable port

• [SLOW TEST:142.202 seconds]
test service connectivity
/Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:37
  when a deployment behind nlb service is created
  /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:150
    nlb service pod should be reachable
    /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:157
------------------------------
test service connectivity when a deployment behind cluster IP is created 
  clusterIP service pod should be reachable
  /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:165
STEP: creating and waiting for deployment to be ready
STEP: creating the service of type ClusterIP
created service
: {LoadBalancer:{Ingress:[]}}
STEP: sleeping for some time to allow service to become ready
STEP: creating jobs to verify service connectivity
STEP: creating negative jobs to verify service connectivity fails for unreachable port

• [SLOW TEST:140.172 seconds]
test service connectivity
/Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:37
  when a deployment behind cluster IP is created
  /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:160
    clusterIP service pod should be reachable
    /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:165
------------------------------
test service connectivity when a deployment behind node port is created 
  node port service pod should be reachable
  /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:173
STEP: creating and waiting for deployment to be ready
STEP: creating the service of type NodePort
created service
: {LoadBalancer:{Ingress:[]}}
STEP: sleeping for some time to allow service to become ready
STEP: creating jobs to verify service connectivity
STEP: creating negative jobs to verify service connectivity fails for unreachable port

• [SLOW TEST:168.695 seconds]
test service connectivity
/Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:37
  when a deployment behind node port is created
  /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:168
    node port service pod should be reachable
    /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/cni/service_connectivity_test.go:173
------------------------------

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

- nlb using in tree service controller
- clb using in tree service controller
- nodeport
- clusterIP
return err
}
observedJob := &v1.Job{}
return wait.PollImmediateUntil(utils.PollIntervalShort, func() (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason we need to wait for the job to be deleted?

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 to cleanly transition to new test case. For instance once the new test is running the older Job's pod will not be in Running/Terminating state so it will not influence the results of the new test cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good :)

deploymentContainer = manifest.NewBusyBoxContainerBuilder().
Image("python").
Command([]string{"python3"}).
Args([]string{"-m", "http.server", "80"}).Build()
Copy link
Contributor

Choose a reason for hiding this comment

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

What about HTTPS? Are you planning to add it later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! I have taken up an AI to add HTTPS tests later.

Copy link
Contributor

@jayanthvn jayanthvn left a comment

Choose a reason for hiding this comment

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

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants