Skip to content

Commit 071f9fc

Browse files
committed
OCPBUGS-44421: Added info on how to remove an NNCP config from network interface
1 parent e4cad0a commit 071f9fc

10 files changed

+80
-17
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/k8s_nmstate/k8s-observing-node-network-state.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="node-network-configuration-policy-file.adoc_{context}"]
7+
= The NodeNetworkConfigurationPolicy manifest file
8+
9+
A `NodeNetworkConfigurationPolicy` (NNCP) manifest file defines policies that the Kubernetes NMState Operator uses to configure networking for nodes that exist in an {product-title} cluster.
10+
11+
After you apply a node network policy to a node, the Kubernetes NMState Operator creates an interface on the node. A node network policy includes your requested network configuration and the status of execution for the policy on the cluster as a whole.
12+
13+
You can create an NNCP by using either the {oc-first} or the {product-title} web console. As a postinstallation task you can create an NNCP or edit an existing NNCP.
14+
15+
[NOTE]
16+
====
17+
Before you create an NNCP, ensure that you read the "Example policy configurations for different interfaces" document.
18+
====
19+
20+
If you want to delete an NNCP, you can use the `oc delete nncp` command to complete this action. However, this command does not delete any created objects, such as a bridge interface.
21+
22+
Deleting the node network policy that added an interface to a node does not change the configuration of the policy on the node. Similarly, removing an interface does not delete the policy, because the Kubernetes NMState Operator recreates the removed interface whenever a pod or a node is restarted.
23+
24+
To effectively delete the NNCP, the node network policy, and any created interfaces would typically require the following actions:
25+
26+
. Edit the NNCP and remove interface details from the file. Ensure that you do not remove `name`, `state`, and `type` parameters from the file.
27+
. Add `state: absent` under the `interfaces.state` section of the NNCP.
28+
. Run `oc apply -f <nncp_file_name>`. After the Kubernetes NMState Operator applies the node network policy to each node in your cluster, the interface that was previously created on each node is now marked _absent_.
29+
. Run `oc delete nncp` to delete the NNCP.

modules/virt-confirming-policy-updates-on-nodes.adoc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
[id="virt-confirming-policy-updates-on-nodes_{context}"]
77
= Confirming node network policy updates on nodes
88

9-
A `NodeNetworkConfigurationPolicy` manifest describes your requested network configuration for nodes in the cluster.
10-
The node network policy includes your requested network configuration and the status of execution of the policy on the cluster as a whole.
11-
12-
139
When you apply a node network policy, a `NodeNetworkConfigurationEnactment` object is created for every node in the cluster. The node network configuration enactment is a read-only object that represents the status of execution of the policy on that node.
1410
If the policy fails to be applied on the node, the enactment for that node includes a traceback for troubleshooting.
1511

modules/virt-example-nmstate-IP-management.adoc

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ The following snippet configures an Ethernet interface that uses a dynamic IP ad
8888
# ...
8989
----
9090

91+
9192
[id="virt-example-nmstate-IP-management-dns_{context}"]
9293
== DNS
9394

@@ -98,7 +99,7 @@ By default, the `nmstate` API stores DNS values globally as against storing them
9899
Setting a DNS configuration is comparable to modifying the `/etc/resolv.conf` file.
99100
====
100101

101-
To define a DNS configuration for a network interface, you must initially specify the `dns-resolver` section in the network interface's YAML configuration file.
102+
To define a DNS configuration for a network interface, you must initially specify the `dns-resolver` section in the network interface's YAML configuration file. To apply an NNCP configuration to your network interface, you need to run the `oc apply -f <nncp_file_name>` command.
102103

103104
[IMPORTANT]
104105
====
@@ -132,6 +133,35 @@ spec:
132133
- 192.0.2.251
133134
# ...
134135
----
136+
+
137+
[IMPORTANT]
138+
====
139+
You can specify DNS options under the `dns-resolver.config` section of your NNCP file as demonstrated in the following example:
140+
141+
[source,terminal]
142+
----
143+
# ...
144+
desiredState:
145+
dns-resolver:
146+
config:
147+
search:
148+
options:
149+
- timeout:2
150+
- attempts:3
151+
# ...
152+
----
153+
154+
If you want to remove the DNS options from your network interface, apply the following configuration to your NNCP and then run the `oc apply -f <nncp_file_name>` command:
155+
156+
[source,terminal]
157+
----
158+
# ...
159+
dns-resolver:
160+
config: {}
161+
interfaces: []
162+
# ...
163+
----
164+
====
135165

136166
The following examples show situations that require configuring a network interface to store DNS values:
137167

modules/virt-nmstate-example-policy-configurations.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
[id="virt-nmstate-example-policy-configurations_{context}"]
77
= Example policy configurations for different interfaces
88

9-
Before you read the different example `NodeNetworkConfigurationPolicy` (NNCP) manifest configurations, consider the following factors when you apply a policy so that your cluster runs at its best performance conditions:
9+
Before you read the different example `NodeNetworkConfigurationPolicy` (NNCP) manifest configurations, consider the following factors when you apply a policy to nodes so that your cluster runs under its best performance conditions:
1010

11-
* When you need to apply a policy to more than one node, create a `NodeNetworkConfigurationPolicy` manifest for each target node. The Kubernetes NMState Operator applies the policy to each node with an NNCP in an unspecified order. Scoping a policy with this approach reduces the length of time for policy application but risks a cluster-wide outage if an error is in the cluster's configuration. To avoid this type of error, initially apply NNCP to some nodes, and after you confirm they are configured correctly, proceed with applying the policy to the remaining nodes.
11+
* When you need to apply a policy to more than one node, create a `NodeNetworkConfigurationPolicy` manifest for each target node. The Kubernetes NMState Operator applies the policy to each node with a defined NNCP in an unspecified order. Scoping a policy with this approach reduces the length of time for policy application but risks a cluster-wide outage if an error exists in the cluster's configuration. To avoid this type of error, initially apply an NNCP to some nodes, confirm the NNCP is configured correctly for these nodes, and then proceed with applying the policy to the remaining nodes.
1212
13-
* When you need to apply a policy to many nodes but you only want to create a single NNCP for all target nodes, the Kubernetes NMState Operator applies the policy to each node in sequence. You can set the speed and coverage of policy application for target nodes with the `maxUnavailable` parameter in the cluster configuration. By setting a lower percentage value for the parameter, you can reduce the risk of a cluster-wide outage if the outage impacts the small percentage of nodes that are receiving the policy application.
13+
* When you need to apply a policy to many nodes but you only want to create a single NNCP for all the nodes, the Kubernetes NMState Operator applies the policy to each node in sequence. You can set the speed and coverage of policy application for target nodes with the `maxUnavailable` parameter in the cluster's configuration file. By setting a lower percentage value for the parameter, you can reduce the risk of a cluster-wide outage if the outage impacts the small percentage of nodes that are receiving the policy application.
1414
1515
* Consider specifying all related network configurations in a single policy.
1616
17-
* When a node restarts, the Kubernetes NMState Operator cannot control the order that it applies policies to nodes. The Kubernetes NMState Operator might apply interdependent policies in a sequence that results in a degraded network object.
17+
* When a node restarts, the Kubernetes NMState Operator cannot control the order to which it applies policies to nodes. The Kubernetes NMState Operator might apply interdependent policies in a sequence that results in a degraded network object.

modules/virt-removing-interface-from-nodes.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ If you remove a bridge or bonding interface, any node NICs in the cluster that w
1414

1515
[NOTE]
1616
====
17-
Deleting the node network policy that added an interface does not change the configuration of the policy on the node.
18-
Although a `NodeNetworkConfigurationPolicy` is an object in the cluster, it only represents the requested configuration. +
19-
Similarly, removing an interface does not delete the policy.
17+
Deleting the node network policy that added an interface does not change the configuration of the policy on the node. Although a `NodeNetworkConfigurationPolicy` is an object in the cluster, the object only represents the requested configuration. Similarly, removing an interface does not delete the policy.
2018
====
2119

2220
.Procedure

networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
= Observing and updating the node network state and configuration
44
include::_attributes/common-attributes.adoc[]
55
:VirtProductName: OpenShift Container Platform
6-
:context: k8s_nmstate-updating-node-network-config
6+
:context: k8s-nmstate-updating-node-network-config
77

88
toc::[]
99

@@ -17,6 +17,16 @@ include::modules/virt-viewing-network-state-of-node.adoc[leveloffset=+1]
1717
// Viewing the network state of a node from the web console
1818
include::modules/virt-viewing-network-state-of-node-console.adoc[leveloffset=+1]
1919

20+
// The `NodeNetworkConfigurationPolicy` manifest file
21+
include::modules/node-network-configuration-policy-file.adoc[leveloffset=+1]
22+
23+
[discrete]
24+
[role="_additional-resources"]
25+
== Additional resources
26+
* xref:../../networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc#virt-nmstate-example-policy-configurations_{context}[Example policy configurations for different interfaces]
27+
28+
* xref:../../networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc#virt-removing-interface-from-nodes_{context}[Removing an interface from nodes]
29+
2030
// Managing policy from the web console
2131
include::modules/virt-node-network-config-console.adoc[leveloffset=+1]
2232

networking/metallb/metallb-configure-bgp-peers.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ include::modules/nw-metallb-configure-vrf-bgppeer.adoc[leveloffset=+1]
3131

3232
* xref:../../networking/multiple_networks/about-virtual-routing-and-forwarding.adoc#cnf-about-virtual-routing-and-forwarding_about-virtual-routing-and-forwarding[About virtual routing and forwarding]
3333
34-
* xref:../../networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc#virt-example-host-vrf_k8s_nmstate-updating-node-network-config[Example: Network interface with a VRF instance node network configuration policy]
34+
* xref:../../networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc#virt-example-host-vrf_k8s-nmstate-updating-node-network-config[Example: Network interface with a VRF instance node network configuration policy]
3535
3636
* xref:../../networking/ovn_kubernetes_network_provider/configuring-egress-traffic-for-vrf-loadbalancer-services.adoc#configuring-egress-traffic-loadbalancer-services[Configuring an egress service]
3737

networking/metallb/metallb-configure-return-traffic.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ include::modules/nw-metallb-configure-return-traffic-proc.adoc[leveloffset=+1]
5959

6060
* xref:../../networking/metallb/metallb-configure-bgp-peers.adoc#nw-metallb-bgp-peer-vrf_configure-metallb-bgp-peers[Exposing a service through a network VRF]
6161

62-
* xref:../../networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc#virt-example-host-vrf_k8s_nmstate-updating-node-network-config[Example: Network interface with a VRF instance node network configuration policy]
62+
* xref:../../networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc#virt-example-host-vrf_k8s-nmstate-updating-node-network-config[Example: Network interface with a VRF instance node network configuration policy]
6363

6464
* xref:../../networking/ovn_kubernetes_network_provider/configuring-egress-traffic-for-vrf-loadbalancer-services.adoc#configuring-egress-traffic-loadbalancer-services[Configuring an egress service]

networking/networking_operators/k8s-nmstate-about-the-k8s-nmstate-operator.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ include::modules/viewing-stats-collected-kubernetes-nmtate-op.adoc[leveloffset=+
5151
[id="additional-resources_k8s-nmstate-view-stats_{context}"]
5252
== Additional resources
5353

54-
* xref:../../networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc#virt-creating-interface-on-nodes_k8s_nmstate-updating-node-network-config[Creating an interface on nodes]
54+
* xref:../../networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc#virt-creating-interface-on-nodes_k8s-nmstate-updating-node-network-config[Creating an interface on nodes]
5555

5656
[id="k8s-nmstate-about-next-steps"]
5757
== Next steps

networking/ovn_kubernetes_network_provider/configuring-egress-traffic-for-vrf-loadbalancer-services.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ include::modules/nw-egress-service-ovn.adoc[leveloffset=+1]
3737

3838
* xref:../../networking/metallb/metallb-configure-bgp-peers.adoc#nw-metallb-bgp-peer-vrf_configure-metallb-bgp-peers[Exposing a service through a network VRF]
3939
40-
* xref:../../networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc#virt-example-host-vrf_k8s_nmstate-updating-node-network-config[Example: Network interface with a VRF instance node network configuration policy]
40+
* xref:../../networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc#virt-example-host-vrf_k8s-nmstate-updating-node-network-config[Example: Network interface with a VRF instance node network configuration policy]
4141
4242
* xref:../../networking/metallb/metallb-configure-return-traffic.adoc#metallb-configure-return-traffic[Managing symmetric routing with MetalLB]
4343

0 commit comments

Comments
 (0)