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 test to verify cni-metrics-helper puts metrics to CW #1461

Merged
merged 3 commits into from
May 19, 2021

Conversation

abhipth
Copy link
Contributor

@abhipth abhipth commented May 11, 2021

Adds metrics helper test which does the following.

  • Installs the metric helper using local helm chart.
  • Adds permission to the node instance role to put metrics to CW.
  • Verifies one of the metrics is published to CW.

What type of PR is this?
Integration test

Which issue does this PR fix:
NA

What does this PR do / Why do we need it:
Add missing integration test for CNI Metrics Helper

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

Testing done on this change:


Running Suite: CNI Metrics Helper Test Suite
============================================
Random Seed: 1620751492
Will run 1 of 1 specs

STEP: creating the CNIMetricsHelperPolicy policy
STEP: getting the node instance profile
STEP: getting the nodegroup name and instance profile
STEP: getting the node instance role
STEP: attaching policy to the node IAM role
STEP: attaching the node instance role
STEP: updating the aws-nodes to restart the metric count
STEP: getting the aws-node daemon set in namesapce kube-system
STEP: setting the environment variables on the ds to map[SOME_NON_EXISTENT_VAR:0]
STEP: updating the daemon set with new environment variable
STEP: installing cni-metrics-helper using helm
time="2021-05-11T22:16:00+05:30" level=info msg="creating 4 resource(s)" source="release_manager.go:77"
time="2021-05-11T22:16:01+05:30" level=info msg="beginning wait for 4 resources with timeout of 0s" source="release_manager.go:77"
time="2021-05-11T22:16:03+05:30" level=info msg="Deployment is not ready: kube-system/cni-metrics-helper. 0 out of 1 expected pods are ready" source="release_manager.go:77"
test cni-metrics-helper publishes metrics when a metric is updated 
  the updated metric is published to CW
  /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/metrics-helper/metric_helper_test.go:44
STEP: creating test namespace
STEP: waiting for the metrics helper to publish initial metrics
STEP: creating parking pods on the targeted node group
STEP: waiting for the metrics helper to publish new metrics
data points: [{
  Maximum: 11,
  Timestamp: 2021-05-11 16:51:00 +0000 UTC,
  Unit: "Count"
} {
  Maximum: 1,
  Timestamp: 2021-05-11 16:47:00 +0000 UTC,
  Unit: "Count"
} {
  Maximum: 1,
  Timestamp: 2021-05-11 16:48:00 +0000 UTC,
  Unit: "Count"
} {
  Maximum: 1,
  Timestamp: 2021-05-11 16:49:00 +0000 UTC,
  Unit: "Count"
} {
  Maximum: 11,
  Timestamp: 2021-05-11 16:50:00 +0000 UTC,
  Unit: "Count"
}]STEP: validating at least 2 metrics are published to CloudWatch
STEP: validating the addReqCount increased on the node after a deployment is created
STEP: deleting test namespace

• [SLOW TEST:374.862 seconds]
test cni-metrics-helper publishes metrics
/Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/metrics-helper/metric_helper_test.go:29
  when a metric is updated
  /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/metrics-helper/metric_helper_test.go:43
    the updated metric is published to CW
    /Users/abhipth/go/src/github.com/aws/amazon-vpc-cni-k8s/test/integration-new/metrics-helper/metric_helper_test.go:44
------------------------------
STEP: getting the aws-node daemon set in namesapce kube-system
STEP: setting the environment variables on the ds to map[SOME_NON_EXISTENT_VAR:{}]
STEP: updating the daemon set with new environment variable
STEP: detaching role policy from the node IAM Role
STEP: deleting the CNIMetricsHelperPolicy policy
STEP: uninstalling cni-metrics-helper using helm
time="2021-05-11T22:23:11+05:30" level=info msg="uninstall: Deleting cni-metrics-helper" source="release_manager.go:77"
time="2021-05-11T22:23:15+05:30" level=info msg="Starting delete for \"cni-metrics-helper\" Deployment" source="release_manager.go:77"
time="2021-05-11T22:23:15+05:30" level=info msg="Starting delete for \"cni-metrics-helper\" ClusterRoleBinding" source="release_manager.go:77"
time="2021-05-11T22:23:15+05:30" level=info msg="Starting delete for \"cni-metrics-helper\" ClusterRole" source="release_manager.go:77"
time="2021-05-11T22:23:15+05:30" level=info msg="Starting delete for \"cni-metrics-helper\" ServiceAccount" source="release_manager.go:77"
time="2021-05-11T22:23:16+05:30" level=info msg="purge requested for cni-metrics-helper" source="release_manager.go:77"

Ran 1 of 1 Specs in 495.397 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS

Ginkgo ran 1 suite in 8m24.614778264s
Test Suite Passed

Automation added to e2e:
NA

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

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

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

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

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.

None yet

3 participants