Bug 1291958 - Kubernetes service exposes wrong port for DNS
Summary: Kubernetes service exposes wrong port for DNS
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Paul Weil
QA Contact: Jianwei Hou
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-16 03:42 UTC by thunt
Modified: 2016-05-12 16:25 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 16:25:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:1064 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 3.2 security, bug fix, and enhancement update 2016-05-12 20:19:17 UTC

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


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