Bug 1291958

Summary: Kubernetes service exposes wrong port for DNS
Product: OpenShift Container Platform Reporter: thunt
Component: NodeAssignee: Paul Weil <pweil>
Status: CLOSED ERRATA QA Contact: Jianwei Hou <jhou>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: aos-bugs, jokerman, mmccomas, tdawson
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 16:25:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description thunt 2015-12-16 03:42:47 UTC
Description of problem:

If default port for DNS in OpenShift master is changed, the Kubernetes DNS service exposes incorrect port for DNS.

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

How reproducible:
Very

Steps to Reproduce:
1. Edit /etc/origin/master/master-config.yaml

2. Change value for dnsConfig: bindAddress: from 0.0.0.0:53 to (say) 0.0.0.0:8053

3. restart atomic-openshift-master


Actual results:

# oc get svc kubernetes
NAME         CLUSTER_IP   EXTERNAL_IP   PORT(S)                 SELECTOR   AGE
kubernetes   172.30.0.1   <none>        443/TCP,8053/UDP,8053/TCP   <none>     22d

Note use of port 8053 which is useless for most DNS clients

S2I and other pods will hang and terminate with error

dial tcp: i/o timeout

Expected results:

# oc get svc kubernetes
NAME         CLUSTER_IP   EXTERNAL_IP   PORT(S)                 SELECTOR   AGE
kubernetes   172.30.0.1   <none>        443/TCP,53/UDP,53/TCP   <none>     22d

Note use of port 53 which is required by libresolv and most DNS clients

S2I processes should run to completion

Additional info:

The following script can be used after restarting the master to fix the Kubernetes service definition

#!/bin/bash --

oc get svc kubernetes -n default -o yaml | \
sed -e '/- name: dns/,+1s/port: [0-9][0-9]*$/port: 53/' | \
oc replace -f -

Comment 1 Paul Weil 2016-01-28 19:43:53 UTC
Looks like this was already fixed in https://github.com/openshift/origin/pull/6341.  The service port will always use 53 and use the config to point to the bind port.

Comment 2 Jianwei Hou 2016-02-03 09:52:12 UTC
Verified on openshift v3.1.1.6

Now the service port always uses 53.

Comment 4 errata-xmlrpc 2016-05-12 16:25:58 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, 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/RHSA-2016:1064