You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting the DNS configuration is analagous to modifying the `/etc/resolv.conf` file. The following snippet sets the DNS configuration on the host.
94
+
By default, the `nmstate` API stores DNS values globally as against storing them in a network interface. For certain situations, you must configure a network interface to store DNS values. 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.
95
95
96
+
[TIP]
97
+
====
98
+
Setting a DNS configuration is comparable to modifying the `/etc/resolv.conf` file.
99
+
====
100
+
101
+
The following examples show situations that require configuring a network interface to store DNS values:
102
+
103
+
[IMPORTANT]
104
+
====
105
+
You cannot use `br-ex` bridge, an OVNKubernetes-managed Open vSwitch bridge, as the interface when configuring DNS resolvers.
106
+
====
107
+
108
+
* Configure a static DNS for a network interface with an automatic IP configuration. Note that for this configuration, you must set the `auto-dns` parameter to `false`, so that the Kubernetes NMState Operator can store custom DNS settings for the network interface.
109
+
+
96
110
[source,yaml]
97
111
----
112
+
dns-resolver:
113
+
config:
114
+
search:
115
+
- example.com
116
+
- example.org
117
+
server:
118
+
- 2001:db8:f::1
119
+
- 192.0.2.251
120
+
interfaces:
121
+
- name: eth1
122
+
type: ethernet
123
+
state: up
124
+
ipv4:
125
+
enabled: true
126
+
dhcp: true
127
+
auto-dns: false
128
+
ipv6:
129
+
enabled: true
130
+
dhcp: true
131
+
autoconf: true
132
+
auto-dns: false
98
133
# ...
99
-
interfaces: <1>
100
-
...
101
-
ipv4:
102
-
...
103
-
auto-dns: false
104
-
...
105
-
dns-resolver:
106
-
config:
107
-
search:
108
-
- example.com
109
-
- example.org
110
-
server:
111
-
- 8.8.8.8
134
+
----
135
+
136
+
* Configure a static DNS for a network interface with a static IP configuration. Note that for this configuration, you must set the `dhcp` parameter to `false` and the `autoconf` parameter to `false`.
137
+
+
138
+
[source,yaml]
139
+
----
140
+
dns-resolver:
141
+
config:
142
+
# ...
143
+
server:
144
+
- 2001:4860:4860::8844
145
+
- 192.0.2.251
146
+
interfaces:
147
+
- name: eth1
148
+
type: ethernet
149
+
state: up
150
+
ipv4:
151
+
enabled: true
152
+
dhcp: false
153
+
address:
154
+
- ip: 192.0.2.251
155
+
prefix-length: 24
156
+
ipv6:
157
+
enabled: true
158
+
dhcp: false
159
+
autoconf: false
160
+
address:
161
+
- ip: 2001:db8:1::1
162
+
prefix-length: 64
163
+
routes:
164
+
config:
165
+
- destination: 0.0.0.0/0
166
+
next-hop-address: 192.0.2.1
167
+
next-hop-interface: eth1
168
+
- destination: ::/0
169
+
next-hop-address: 2001:db8:1::3
170
+
next-hop-interface: eth1
112
171
# ...
113
172
----
114
-
<1> You must configure an interface with `auto-dns: false` or you must use static IP configuration on an interface in order for Kubernetes NMState to store custom DNS settings.
115
173
116
-
[IMPORTANT]
117
-
====
118
-
You cannot use `br-ex`, an OVNKubernetes-managed Open vSwitch bridge, as the interface when configuring DNS resolvers.
119
-
====
174
+
* Configure a static DNS name server to append to Dynamic Host Configuration Protocol (DHCP) and IPv6 Stateless Address AutoConfiguration (SLAAC) servers:
Copy file name to clipboardExpand all lines: networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.adoc
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,13 +42,13 @@ The following examples show different `NodeNetworkConfigurationPolicy` manifest
42
42
43
43
For best performance, consider the following factors when applying a policy:
44
44
45
-
* When you need to apply a policy to more than one node, create a `NodeNetworkConfigurationPolicy` manifest for each target node. Scoping a policy to a single node reduces the overall length of time for the Kubernetes NMState Operator to apply the policies.
45
+
* When you need to apply a policy to more than one node, create a `NodeNetworkConfigurationPolicy` manifest for each target node. Scoping a policy to a single node reduces the overall length of time for the Kubernetes NMState Operator to apply the policies.
46
46
+
47
-
In contrast, if a single policy includes configurations for several nodes, the Kubernetes NMState Operator applies the policy to each node in sequence, which increases the overall length of time for policy application.
47
+
In contrast, if a single policy includes configurations for several nodes, the Kubernetes NMState Operator applies the policy to each node in sequence, which increases the overall length of time for policy application.
48
48
49
-
* All related network configurations should be specified in a single policy.
49
+
* All related network configurations should be specified in a single policy.
50
50
+
51
-
When a node restarts, the Kubernetes NMState Operator cannot control the order in which policies are applied. Therefore, the Kubernetes NMState Operator might apply interdependent policies in a sequence that results in a degraded network object.
51
+
When a node restarts, the Kubernetes NMState Operator cannot control the order in which policies are applied. Therefore, the Kubernetes NMState Operator might apply interdependent policies in a sequence that results in a degraded network object.
0 commit comments