Bug 2058511

Summary: On-prem prepender dispatcher script overwrites DNS search settings
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: Machine Config OperatorAssignee: Christoph Stäbler <cstabler>
Machine Config Operator sub component: platform-baremetal QA Contact: Aleksandra Malykhin <amalykhi>
Status: CLOSED ERRATA Docs Contact:
Severity: urgent    
Priority: urgent CC: aos-bugs, cstabler, m.andre, pibanezr, rupatel, tsedovic, vpickard
Version: 4.10   
Target Milestone: ---   
Target Release: 4.9.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-16 11:39:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2017564    
Bug Blocks: 2058789    

Comment 4 Aleksandra Malykhin 2022-02-28 12:43:05 UTC
Verified on 
Cluster version is 4.9.0-0.nightly-2022-02-26-024514
Kubernetes NMState Operator   4.9.0-202202120107

1. Deploy the cluster 
2. Install nmstate operator

3. Apply the network policy
[kni@provisionhost-0-0 ~]$ oc apply -f dns.yaml 
nodenetworkconfigurationpolicy.nmstate.io/amdns created
[kni@provisionhost-0-0 ~]$ oc get nncp
NAME    STATUS
amdns   Available

4. Go to the node and verify that the resolv.conf was updated

[kni@provisionhost-0-0 ~]$ ssh core@worker-0-0
[core@worker-0-0 ~]$ cat /etc/resolv.conf 
# Generated by KNI resolv prepender NM dispatcher script
search ocp-edge-cluster-0.qe.lab.redhat.com example.com
nameserver 192.168.123.119
nameserver 8.8.8.8
nameserver 192.168.123.1


====================================
cat dns.yaml
apiVersion: nmstate.io/v1beta1
kind: NodeNetworkConfigurationPolicy
metadata:
  name: amdns
spec:
  nodeSelector:
    kubernetes.io/hostname: worker-0-0
  desiredState:
    dns-resolver:
      config:
        search:
        - example.com
        server:
        - 8.8.8.8
    interfaces:
    - name: enp0s3
      type: ethernet
      state: up
      ipv4:
        auto-dns: false
        enabled: true
        dhcp: true

Comment 7 errata-xmlrpc 2022-03-16 11:39:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.9.24 bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:0798