-
Notifications
You must be signed in to change notification settings - Fork 14
Add dynamic ranges to generated communication matrix #275
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
base: main
Are you sure you want to change the base?
Add dynamic ranges to generated communication matrix #275
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shirmoran The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cc @yuvalk |
1d8a21f to
ed8384d
Compare
This PR is adding the following changes: 1. As requested from the partenrs, the dynamic port ranges of the cluster (Linux dynamic\private ranges, kubelet node port dynamic range, host level services dynamic range), are added to the generated communication matrix in all of the supported formats. The dynamic ranges are extracted in the following ways: - Host level services range: are set by a static defined range (9000-9999). - Node port dynamic range: we are looking for a custom defined range (network.Spec.ServiceNodePortRange), if there is no range set, we use a default static range (30000-32767) - Linux dynamic\private range: we retrive the dynamic range by reading the host sysctl (/proc/sys/net/ipv4/ip_local_port_range). 2. We also have added the option of using a custom entries file that include ranges, so partners will be able to add their own ranges if needed. 3. The e2e tests have been modified the following: - EPS vs SS: in the comparsion between the matrices, we also check if host level open ports (from ss matrix) which don't have an EPS are in the range specified in the generated commatrix. - Doc vs EPS: in the comparison between the matrices, we also chcek if the ports in the genereted commatrix which are not documented in the doc matrix, do appear in the doc ranges. 4. The custom entries samples had been modified to also include ranges. 5. commatrix.go file's unit tests had been modified to allow mocking of a debugpod in the tests. For that sense, we have added to the commatrixCreator struct a utils field similar to what's done in the ConnectionCheck struct.
ed8384d to
4316ac0
Compare
| return nil, fmt.Errorf("failed creating the endpointslices exporter %s", err) | ||
| } | ||
|
|
||
| utilsHelpers := utils.New(o.cs) |
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 think this is not needed u can use the one that we created here https://github.com/openshift-kni/commatrix/pull/275/files#diff-519e796aff368e7c5d1c963bb54326c65a3b21fb9ebcf3a8ab1fb642897e68fbL107:~:text=%3A%20%20%20%20%20%20%20%20%20%20%20cs%2C-,utilsHelpers,-%3A%20utils.
o. utilsHelpers is there also
|
|
||
| // GetNodePortDynamicRange returns the cluster's Service NodePort range as dynamic ranges. | ||
| // If the cluster does not define a custom range, it falls back to the Kubernetes default (30000-32767). | ||
| func (cm *CommunicationMatrixCreator) getNodePortDynamicRange() ([]types.DynamicRange, error) { |
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.
why not to create a file for the get dynamic stuff and on the commatrix creator to call it like what we are doing with the endpointslice?
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.
Yes okay let's do that. Thanks!
This PR is adding the following changes:
We also have added the option of using a custom entries file that include ranges, so partners will be able to add their own ranges if needed.
The e2e tests have been modified the following: