Skip to content

[Native K8s]: E2E test implementation in IAD #31

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

Merged
merged 3 commits into from
Apr 17, 2024
Merged

[Native K8s]: E2E test implementation in IAD #31

merged 3 commits into from
Apr 17, 2024

Conversation

majanjua-amzn
Copy link
Contributor

@majanjua-amzn majanjua-amzn commented Mar 25, 2024

We want to test app signals on native kubernetes.
I have set up a native K8s cluster in IAD using kubeadm running on two EC2 instances (a master and worker node). The cluster is set to be clean (no operator or sample app) while the test is not running. Due to the cluster set up being quite complicated, this test is only set up in IAD as of now. Future effort may be assigned to extending this to all regions.

This test adds the requirement for the following IAM policies to be added the the EC2 IAM instance profile used in the test case:

  • AmazonS3FullAccess (instead of AmazonS3ReadOnlyAccess): Used to push and pull the deployment files for the sample application using the existing e2e test related S3 bucket
  • AmazonSSMFullAccess: Used to push and pull the remote service pod IP (this cannot be emitted from the SSH connection to the terraform, and this alternative solution provides a way for us to emit and collect this information)
  • AWSAppRunnerServicePolicyForECRAccess: Used to pull the ECR images for the main and remote service of our sample application

This change is already done and verified in the IAD account.

Description of changes:

  • Implemented terraform scripts for deployment and teardown of operator + sample app
    • The scripts use an SSH connection to access a preexisting kubeadm native kubernetes cluster that is placed in our IAD testing account and that runs on 2 EC2 instances running Amazon Linux 2
  • Implemented workflow to run the terraform and validation + emit metrics
  • Implemented canary to call this workflow every 15 minutes
  • Added validations for K8s use case to validator
  • Also removed unused TEST environment variable from ec2 test case

Testing:

  • 7 test runs: link
  • 7 more test runs: link
  • 7 more test runs after changing to <<-EOF syntax as per comments: link
  • 7 more test runs after addressing more comments relating to region environment variable: link

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

* Implemented terraform scripts for deployment and teardown of operator + sample app
* Implemented workflow to run the terraform and validation + emit metrics
* Implemented canary to call this workflow every 15 minutes
* Added validations for K8s use case to validator
@majanjua-amzn majanjua-amzn added the enhancement New feature or request label Mar 25, 2024
@majanjua-amzn majanjua-amzn requested a review from harrryr March 25, 2024 22:48
@majanjua-amzn majanjua-amzn self-assigned this Mar 25, 2024
@majanjua-amzn majanjua-amzn force-pushed the k8s branch 2 times, most recently from 5e67a36 to 03d95c8 Compare April 2, 2024 21:07
@harrryr harrryr self-requested a review April 15, 2024 17:22
@majanjua-amzn majanjua-amzn force-pushed the k8s branch 2 times, most recently from fd161bb to 18ac4a6 Compare April 17, 2024 18:42
@majanjua-amzn majanjua-amzn merged commit abe5925 into main Apr 17, 2024
@zzhlogin zzhlogin deleted the k8s branch June 6, 2024 18:16
zzhlogin pushed a commit to zzhlogin/aws-application-signals-test-framework that referenced this pull request Jun 6, 2024
zzhlogin pushed a commit to zzhlogin/aws-application-signals-test-framework that referenced this pull request Jun 6, 2024
zzhlogin pushed a commit to zzhlogin/aws-application-signals-test-framework that referenced this pull request Jun 6, 2024
zzhlogin pushed a commit to zzhlogin/aws-application-signals-test-framework that referenced this pull request Jun 6, 2024
georgeboc pushed a commit to georgeboc/aws-application-signals-test-framework that referenced this pull request Jul 8, 2024
…vability#31)

*Description of changes:*
Added a random-traffic-generator for the Python Sample App. More details
can be found in the README under
`aws-otel-python-instrumentation/sample-applications/vehicle-dealership-sample-app/random-traffic-generator`.

The traffic generator generates the following traffic:
1. Every minute, sends a single POST request to the VehicleInventoryApp
and sends a single GET request.
2. Every hour, sends a burst of requests: 5 POST requests to the
VehicleInventoryApp and 5 GET requests.
3. Every 5 minutes, sleeps for random amount of time between 30-60
seconds and then sends a GET request to the VehicleInventoryApp with a
random throttle param between 5-20 seconds. The backend reads that
throttle param and simulates throttling for that amount of time before
responding to the request.
4. Every 5 minutes, sleeps for random amount of time between 30-60
seconds and then sends a GET request to the VehicleInventoryApp with an
invalid car id to trigger 404 error.
5. Every 5 minutes, sleeps for random amount of time between 30-60
seconds and then sends a GET request to the ImageServiceApp with a non
existent image name to trigger 500 error due to S3 Error: "An error
occurred (NoSuchKey) when calling the GetObject operation: The specified
key does not exist."

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants