Skip to content

Conversation

@shirmoran
Copy link
Collaborator

@shirmoran shirmoran commented Nov 27, 2025

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).
  1. 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.

  2. 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 check if the ports in the generated commatrix which are not documented in the doc matrix, do appear in the doc ranges.
  1. The custom entries samples had been modified to also include ranges.
  2. 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.

@openshift-ci openshift-ci bot requested review from SchSeba and aabughosh November 27, 2025 11:54
@openshift-ci
Copy link

openshift-ci bot commented Nov 27, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: shirmoran
Once this PR has been reviewed and has the lgtm label, please assign oribon for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@shirmoran
Copy link
Collaborator Author

/cc @yuvalk

@openshift-ci openshift-ci bot requested a review from yuvalk November 27, 2025 11:55
@shirmoran shirmoran force-pushed the add-dynamic-range-to-commatrix branch 4 times, most recently from 1d8a21f to ed8384d Compare December 3, 2025 08:02
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.
@shirmoran shirmoran force-pushed the add-dynamic-range-to-commatrix branch from ed8384d to 4316ac0 Compare December 3, 2025 15:09
return nil, fmt.Errorf("failed creating the endpointslices exporter %s", err)
}

utilsHelpers := utils.New(o.cs)
Copy link
Collaborator

Choose a reason for hiding this comment

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


// 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) {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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!

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