7.10. roxctl netpol
Commands related to the network policies.
Usage
$ roxctl netpol [command] [flags]
| Command | Description |
|---|---|
|
| Connectivity analysis of the network policy resources. |
|
| Recommend network policies based on the deployment information. |
7.10.1. roxctl netpol command options inherited from the parent command 링크 복사링크가 클립보드에 복사되었습니다!
The roxctl netpol command supports the following options inherited from the parent roxctl command:
| Option | Description |
|---|---|
|
|
Specify a custom CA certificate file path for secure connections. Alternatively, you can specify the file path by using the |
|
|
Set |
|
|
Set the endpoint for the service to contact. Alternatively, you can set the endpoint by using the |
|
|
Force the use of HTTP/1 for all connections. Alternatively, by setting the |
|
|
Enable insecure connection options. Alternatively, by setting the |
|
|
Skip the TLS certificate validation. Alternatively, by setting the |
|
|
Disable the color output. Alternatively, by setting the |
|
|
Specify the password for basic authentication. Alternatively, you can set the password by using the |
|
|
Use an unencrypted connection. Alternatively, by setting the |
|
|
Set the TLS server name to use for SNI. Alternatively, you can set the server name by using the |
|
|
Use the API token provided in the specified file for authentication. Alternatively, you can set the token by using the |
These options are applicable to all the sub-commands of the roxctl netpol command.
7.10.2. roxctl netpol generate 링크 복사링크가 클립보드에 복사되었습니다!
Recommend network policies based on the deployment information.
Usage
$ roxctl netpol generate <folder_path> [flags]
where:
<folder_path>- Specifies the path to the directory containing your Kubernetes deployment and service configuration files.
| Option | Description |
|---|---|
|
| Specify the DNS port or a named port that you want to use in the egress rules of synthesized network policies. For example:
|
|
|
Fail on the first encountered error. The default value is |
|
| Save generated policies into the target folder. |
|
| Save and merge generated policies into a single YAML file. |
|
|
Remove the output path if it already exists. The default value is |
|
|
Treat warnings as errors. The default value is |
If you do not specify a port, the roxctl netpol generate command uses port 53 for DNS connections.
If you are using OpenShift Container Platform, you might need to change the port when generating network policies by using the roxctl CLI. If you do not change the port, OpenShift Container Platform uses port 5353 and assigns the name dns for this port automatially. You can use the --dnsport option to override the default DNS port. For example:
-
roxctl netpol generate --dnsport 5353 <other_options> -
roxctl netpol generate --dnsport dns <other-options>.
7.10.3. roxctl netpol connectivity 링크 복사링크가 클립보드에 복사되었습니다!
Commands related to the connectivity analysis of the network policy resources.
Usage
$ roxctl netpol connectivity [flags]
7.10.3.1. roxctl netpol connectivity map 링크 복사링크가 클립보드에 복사되었습니다!
Analyze connectivity based on the network policies and other resources.
Usage
$ roxctl netpol connectivity map <folder_path> [flags]
where:
<folder_path>- Specifies the path to the directory containing your Kubernetes deployment and service configuration files.
| Option | Description |
|---|---|
|
|
Enhance the analysis of permitted connectivity by using exposure analysis. The default value is |
|
|
Fail on the first encountered error. The default value is |
|
| Focus on connections of the specified workload name in the output. |
|
| Save the connections list output into a specific file. |
|
|
Configure the connections list in a specific format. Supported formats include |
|
|
Remove the output path if it already exists. The default value is |
|
|
Define whether you want to save the output of the connection list in the default file. The default value is |
|
|
Treat warnings as errors. The default value is |
7.10.3.2. roxctl netpol connectivity diff 링크 복사링크가 클립보드에 복사되었습니다!
Report connectivity differences based on two network policy directories and YAML manifests with workload resources.
Usage
$ roxctl netpol connectivity diff [flags]
| Option | Description |
|---|---|
|
| Specify the first directory path of the input resources. This value is mandatory. |
|
| Specify the second directory path of the input resources that you want to compare with the first directory path. This value is mandatory. |
|
|
Fail on the first encounter. The default value is |
|
| Save the output of the connectivity difference command into a specific file. |
|
|
Configure the output of the connectivity difference command in a specific format. Supported formats include |
|
|
Remove the output path if it already exists. The default value is |
|
|
Define whether you want to store the output of the connectivity differences in the default file. The default value is |
|
|
Treat warnings as errors. The default value is |