Bug 1662253 - Cannot set '--cluster-dns' value by dnsIP
Summary: Cannot set '--cluster-dns' value by dnsIP
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 3.11.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.11.z
Assignee: Dan Mace
QA Contact: Hongan Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-27 08:13 UTC by Min Woo Park
Modified: 2022-08-04 22:20 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-11 00:39:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Min Woo Park 2018-12-27 08:13:11 UTC
Description of problem:

By default, dnsIP is 0.0.0.0 and the --cluster-dns flag is set to that of the host by looking for the first up, non-loopback interface and getting the first IPv4 address from it. 

When OCP was installed in mutiple NICs environment, '--cluster-dns' can be configured as a unwanted IP address.

We can set '--clsuter-dns' value by setting dnsIP in /etc/origing/node/node-config.yaml.
But we cannot use dnsIP from ocp 3.10, because if I configure dnsIP in config map then the IP was set to all nodes.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:
Want to set '--cluster-dns' to the specific IP address.

Additional info:

Comment 1 Min Woo Park 2018-12-28 05:58:40 UTC
Hello,

I explain the issue more details.

When openshift was installed in mutiple NICs environment, I set one NIC which used by openshift as the default GW in the node host.
Because the nameserver IP in "/etc/resolv.conf" of node host will be configured with default GW NIC's IP address by "99-origin-dns.sh" script.

I could see correct nameserver IP in "/etc/resolv.conf" of node host.

But nameserver IP in "/etc/resolv.conf" of POD was different with that in "/etc/resolv.conf" of node host.

dnsIP : Configures an IP address to be prepended to a pod’s /etc/resolv.conf by adding the address here.

"dnsIP" is 0.0.0.0 by default.
I could see nodeConfig.DNSIP was set from nodeConfig.NodeIP. [1]
If nodeIP was not set, dnsIP can be set to that of the host by looking for the first up, non-loopback interface and getting the first IPv4 address from it. 

BTW from ocp 3.10, node configuration is controlled via a set of configmaps maintained in the openshift-node namespace. 
Since node configuration is managed on a per-node group basis, it is now no longer possible to specify many configuration variables that may have varied on a per host basis, such as openshift_node_ip, openshift_dns_ip, etc. 

So dnsIP can be random IP in multiple NICs environment.

As a workaround, I could create a node group for each node host and set node_ip in that node group something like,
{'name': 'node-config-node1', 'labels': ['...,...']}, 'edits': [{ 'key': 'kubeletArguments.node-ip','value': ['x.x.x.x']}]}

But my customer hopes that dnsIP can be set same with nameserver IP in "/etc/resolv.conf" of node host.

Thanks,

[1] https://github.com/openshift/origin/pull/19734/files#diff-3f3631b751f92dbca795eba99e445c4fR33


Note You need to log in before you can comment on or make changes to this bug.