Bug 1291958 - Kubernetes service exposes wrong port for DNS
Kubernetes service exposes wrong port for DNS
Product: OpenShift Container Platform
Classification: Red Hat
Component: Pod (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Paul Weil
Jianwei Hou
Depends On:
  Show dependency treegraph
Reported: 2015-12-15 22:42 EST by thunt
Modified: 2016-05-12 12:25 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-05-12 12:25:58 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:1064 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 3.2 security, bug fix, and enhancement update 2016-05-12 16:19:17 EDT

  None (edit)
Description thunt 2015-12-15 22:42:47 EST
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):

How reproducible:

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

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

3. restart atomic-openshift-master

Actual results:

# oc get svc kubernetes
NAME         CLUSTER_IP   EXTERNAL_IP   PORT(S)                 SELECTOR   AGE
kubernetes   <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   <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 14:43:53 EST
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 04:52:12 EST
Verified on openshift v3.1.1.6

Now the service port always uses 53.
Comment 4 errata-xmlrpc 2016-05-12 12:25:58 EDT
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.


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