-
Notifications
You must be signed in to change notification settings - Fork 527
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
Network policy latency test clients v.0.0.1 #2226
Network policy latency test clients v.0.0.1 #2226
Conversation
/assign @alan-kut |
@dlapcevic: GitHub didn't allow me to assign the following users: alan-kut. Note that only kubernetes members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
57d1c63
to
34e7d46
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't reviewed it fully yet.
Here is first batch of comments.
PTAL
34e7d46
to
268b83e
Compare
if c.config.podCreationMode { | ||
if err := c.measurePodCreation(); err != nil { | ||
klog.Errorf("Pod creation test failed, error: %v", err) | ||
} | ||
} else { | ||
if err := c.measureNetPolicyCreation(); err != nil { | ||
klog.Errorf("Pod creation test failed, error: %v", err) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like it. If I'm not mistake majority of the code is for either pod or policy.
Some common code could be extracted to some utils or library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Most of the functionality besides initialization and sending a request is not common to the modes.
I will extract the common code to utils package and separate it into 2 applications. We can run both in the scale tests.
Sounds good?
} | ||
|
||
c.policyCreatedTime.lock.Unlock() | ||
if failed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens in this case?
Don't we lose some test data because of this?
Doesn't it mean that request was sent before the policy was deployed?
Can't we wait for the policy before testing reachability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Policy creation test starts sending traffic before allow policy is created.
Once allow policy is created, the requests to pods will succeed, and the policy will exist to measure latency for its creation.
If the policy cannot be retrieved here, it means the setup is incorrect. The warning log will make it clear that the specified allow policy is not found. No metrics should be generated from it.
268b83e
to
016a828
Compare
I refactored the code. Extracted all common code into a separate package and split the modes into two applications |
016a828
to
f22777b
Compare
/LGTM |
@alan-kut: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alan-kut, dlapcevic, marseel 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:
Approvers can indicate their approval by writing |
A golang client application that runs in pods inside a K8s cluster, and measures network policy enforcement latency for changes to pods and network policies.
Details are in the README.md file.
Main purpose: Test network policy performance and scalability by using it with ClusterLoader2 framework.
/kind feature