Configure Cluster DNS¶
Enable Cluster DNS to provide dynamic hostname resolution for Slurm, login, and Kubernetes nodes using CoreDNS instead of static /etc/hosts file management.
Overview¶
Cluster DNS replaces per-node /etc/hosts synchronization with coresmd, a CoreDNS instance on the OIM that generates DNS records automatically from the OpenCHAMI SMD inventory. For a full explanation of the architecture, DNS ownership boundaries, and failure behavior, see Cluster DNS.
Prerequisites¶
- Omnia is deployed on the OIM node with OpenCHAMI services running.
/opt/omnia/input/project_default/provision_config.ymlexists and is validated.- The OIM node is accessible on the admin network.
Procedure¶
Enable Cluster DNS¶
-
Edit the provision configuration file on the OIM node:
Run on: OIM hostvi /opt/omnia/input/project_default/provision_config.yml -
Set the
dns_enabledparameter totrue:File: /opt/omnia/input/project_default/provision_config.ymldns_enabled: trueNote
The default value is
false, which preserves the legacy/etc/hostsbehavior. -
Deploy or redeploy OpenCHAMI with coresmd (if not already deployed):
Run on: omnia_core containercd /omnia/prepare_oim ansible-playbook prepare_oim.yml -
Run the provisioning playbook so nodes receive cloud-init with
/etc/resolv.confconfigured:Run on: omnia_core containercd /omnia/provision ansible-playbook provision.yml -
Reprovision (reboot) all compute nodes to apply the new cloud-init configuration.
Important
Nodes must be reprovisioned after setting
dns_enabled: truefor the change to take effect. Existing nodes retain their previous configuration until reprovisioned.
Disable Cluster DNS (Revert to /etc/hosts)¶
-
Edit
provision_config.ymland setdns_enabledtofalse:File: /opt/omnia/input/project_default/provision_config.ymldns_enabled: false -
Re-run the provisioning playbook to regenerate cloud-init configuration:
Run on: omnia_core containercd /omnia/provision ansible-playbook provision.yml -
Reprovision (reboot) all compute nodes to apply the new cloud-init configuration.
Note
No coresmd or OpenCHAMI changes are needed for rollback. coresmd continues running but compute nodes no longer query it.
Verification¶
-
Verify the compute node resolver configuration:
Run on: compute nodecat /etc/resolv.confExpected outputsearch <domain_name> nameserver <admin_nic_ip> options timeout:1 attempts:2 -
Verify no peer entries exist in
/etc/hosts(only localhost entries should be present):Run on: compute nodecat /etc/hosts -
Verify forward DNS resolution for a cluster hostname:
Run on: compute nodegetent hosts <hostname>.<domain>Expected output172.16.0.1 nid001.hpc.cluster -
Query coresmd directly from the OIM node or any node with network access to it:
Run on: OIM hostdig <hostname>.<domain> @<admin_nic_ip>Expected output includes an
ANSWER SECTIONwith the node's admin IP address. -
Verify Kubernetes CoreDNS patching (if Kubernetes is deployed). Confirm the ConfigMap contains the forward zone:
Run on: kube_control_planekubectl -n kube-system get configmap coredns -o yamlExpected outputhpc.cluster:53 { errors cache 30 forward . 172.16.107.254 } -
Verify Kubernetes pod resolution (if Kubernetes is deployed):
Run on: kube_control_planekubectl exec -it <pod> -- getent hosts <hostname>.<domain> -
Verify Slurm and MPI functionality:
Run on: OIM hostsinfo srun -N <N> hostname mpirun -np 4 -host <host1>,<host2> hostnameAll nodes should show as
IDLEorALLOCATEDinsinfo, and jobs should complete without DNS errors or timeouts. -
Verify new node auto-resolution. After adding a node via
provision.yml, wait up to 30 seconds for coresmd to refresh its cache, then confirm resolution without any playbook re-run:Run on: compute nodegetent hosts <new_hostname>
Troubleshooting¶
Custom hostnames not resolving
Custom hostnames from the PXE mapping file resolve via /etc/hosts, not CoreDNS. If a custom hostname does not resolve, check that it is present in /etc/hosts:
grep <hostname> /etc/hosts
If missing, re-run provision.yml to repopulate /etc/hosts.
Mixed-state cluster
If some nodes resolve via DNS while others use /etc/hosts, only some nodes were reprovisioned after changing dns_enabled. Check /etc/resolv.conf on the affected nodes to determine which mode they are using, then reprovision and reboot all nodes for a consistent configuration.
Best Practices¶
- Plan DNS mode before deployment -- Decide on DNS mode before the initial cluster deployment. Changing mode afterward requires reprovisioning all nodes.
- Monitor coresmd health -- Track coresmd container status and logs, and use Prometheus metrics (port 9153) to monitor DNS query performance.
- Configure reliable upstream DNS -- Configure at least two reliable upstream DNS servers in
admin_network.dnsand test connectivity before enabling Cluster DNS. - Test resolution before production -- Verify DNS resolution, Slurm/MPI job execution, and Kubernetes pod resolution before running production workloads.
- Document domain configuration -- Record the cluster domain name and hostname pattern (
cluster_shortname,cluster_nidlength) for reference. - Plan for high availability -- The OIM node is a single point of failure for DNS in the current implementation. Plan for OIM HA deployment and monitor OIM node health.
- Use short-name resolution -- Leverage the
search <domain_name>directive so users can reference short hostnames instead of FQDNs. - Validate after node changes -- After adding or removing nodes, verify DNS resolution within 30 seconds using
digorgetent hosts.
Next Steps¶
- Configure InfiniBand -- Configure the high-speed interconnect network.
Related pages
- Cluster DNS -- Architecture, DNS ownership boundaries, and failure scenarios.
- Provision Config -- Reference for the
dns_enabledparameter. - Known Limitations -- Cluster DNS constraints.