Skip to content

OSDOCS-12848: Added /etc/resolv.conf modification to resolve DNS conn… #91520

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions modules/k8s-nmstate-deploying-nmstate-CLI.adoc
Original file line number Diff line number Diff line change
@@ -92,6 +92,23 @@ metadata:
EOF
----

. Optional: If your cluster gets disconnected from a DNS server because of DNS connectivity issues, you can add the following DNS hostname configuration to the `NMState` CRD to build in health checks that can resolve these issues:
+
[source,terminal]
----
apiVersion: nmstate.io/v1
kind: NMState
metadata:
name: nmstate
spec:
probeConfiguration:
dns:
host: redhat.com
# ...
----

.Verification

. Verify that all pods for the NMState Operator are in a `Running` state:
+
[source,terminal]
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Module included in the following assemblies:
//
// * networking/k8s_nmstate/k8s-nmstate-troubleshooting-node-network.adoc

:_mod-docs-content-type: PROCEDURE
[id="k8s-nmstate-troubleshooting-dns-disconnected-env-resolv.adoc_{context}"]
= Creating a custom DNS host name to resolve DNS connectivity issues

In a disconnected environment where a host server cannot be reached, you can resolve DNS connectivity issues by specifying a custom DNS host name in the `NMState` custom resource definition (CRD). The Kubernetes NMState Operator adds the custom DNS host name to the `/etc/resolv.conf` file. If your cluster gets disconnected, the Operator reads the `/etc/resolv.conf` and uses the custom DNS host name to resolve the DNS connectivity issue.

.Procedure

* Add the DNS host name configuration to the `NMState` CRD of your cluster:
+
[source,terminal]
----
apiVersion: nmstate.io/v1
kind: NMState
metadata:
name: nmstate
spec:
probeConfiguration:
dns:
host: redhat.com
# ...
----

7 changes: 3 additions & 4 deletions modules/k8s-nmstate-troubleshooting-dns-disconnected-env.adoc
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
[id="troubleshooting-dns-disconnected-env_{context}"]
= Troubleshooting DNS connectivity issues in a disconnected environment

If you experience DNS connectivity issues when configuring `nmstate` in a disconnected environment, you can configure the DNS server to resolve the list of name servers for the domain `root-servers.net`.
If you experience DNS connectivity issues when configuring `nmstate` in a disconnected environment, you can configure the DNS server to resolve the list of name servers for the domain `root-servers.net`. Alternatively, you can resolve DNS connectivity issues by configuring a custom host name and then using the hostname to perform internal networking health checks on your cluster.

[IMPORTANT]
====
@@ -15,8 +15,7 @@ Ensure that the DNS server includes a name server (NS) entry for the `root-serve

== Configuring the bind9 DNS named server

For a cluster configured to query a `bind9` DNS server, you can add the `root-servers.net` zone to a configuration file that contains at least one NS record.
For example you can use the `/var/named/named.localhost` as a zone file that already matches this criteria.
For a cluster configured to query a `bind9` DNS server, you can add the `root-servers.net` zone to a configuration file that contains at least one NS record. For example you can use the `/var/named/named.localhost` as a zone file that already matches this criteria.

.Procedure

@@ -69,4 +68,4 @@ Name: 127.0.0.1
Address: 127.0.0.53
Aliases:
root-servers.net name server root-servers.net.
----
----
Original file line number Diff line number Diff line change
@@ -14,8 +14,14 @@ This includes issues such as:
* The host loses connection to the default gateway.
* The host loses connection to the API server.

// Troubleshooting an incorrect node network configuration policy configuration
include::modules/virt-troubleshooting-incorrect-policy-config.adoc[leveloffset=+1]

// Troubleshooting DNS connectivity issues in a disconnected environment
include::modules/k8s-nmstate-troubleshooting-dns-disconnected-env.adoc[leveloffset=+1]

// Creating a custom DNS host name to resolve DNS connectivity issues
include::modules/k8s-nmstate-troubleshooting-dns-disconnected-env-resolv.adoc[leveloffset=+2]

// Configuring the dnsmasq DNS server
include::modules/k8s-nmstate-troubleshooting-dns-disconnected-env-dnsmasq.adoc[leveloffset=+2]