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 Hop Limit Test For EKS metric_value_benchmark Test #401

Closed
wants to merge 1 commit into from

Conversation

sethAmazon
Copy link
Contributor

@sethAmazon sethAmazon commented Apr 10, 2024

Description of the issue

There is no way to test what happens when hop limit is 1 for EKS

Description of changes

Add hop limit 1 EKS test

License

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

Tests

https://github.com/aws/amazon-cloudwatch-agent/actions/runs/8726746471/job/23943412898

@sethAmazon sethAmazon requested a review from a team as a code owner April 10, 2024 18:18
"ami": "AL2_x86_64",
"instanceType":"t3a.medium",
"instanceType":"t3.medium",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were testing against t3.medium since it was hard coded into the test

@@ -44,13 +45,14 @@ type testConfig struct {
runMockServer bool
// define target matrix field as set(s)
// empty map means a testConfig will be created with a test entry for each entry from *_test_matrix.json
targets map[string]map[string]struct{}
targets map[string]map[any]struct{}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

hop limit is an int and not a string

Copy link
Contributor

Choose a reason for hiding this comment

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

I was curious if it were plausible and better practice to parse hop_limit into a string, but it makes sense to validate hop_limit as an int.

}

variable "hop_limit" {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All these are here because we pass in hop limit through the gha and w/o this the tests will not execute

capacity_type = "ON_DEMAND"
disk_size = 20
instance_types = ["t3.medium"]
instance_types = [var.instance_type]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instance type needs to come from the input

@@ -47,10 +47,10 @@ resource "aws_eks_node_group" "this" {
min_size = 1
}

ami_type = "AL2_x86_64"
ami_type = var.ami_type
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ami needs to come from the input

]
provisioner "local-exec" {
command = <<-EOT
go run ./modify_hop_limit ${aws_eks_cluster.this.name} ${var.hop_limit}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was having issues creating a launch template so I created a function that will change the hop limit after nodes are already created

if err != nil {
log.Fatalf("could not get instances for input %v %v", instanceInput, err)
}
for _, reservation := range instanceOutput.Reservations {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Easier to do this with structs than cli commands

@sethAmazon
Copy link
Contributor Author

Do not merge until @jefchien finishes the eks get metadata w/o imds changes are done

@sethAmazon sethAmazon marked this pull request as draft April 17, 2024 18:13
@sethAmazon sethAmazon marked this pull request as ready for review April 17, 2024 19:33
@sethAmazon sethAmazon closed this May 24, 2024
@sethAmazon sethAmazon deleted the hop-limit-1-test branch May 24, 2024 16:33
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