Bug 1641221 - dnsPolicy: none not honored
Summary: dnsPolicy: none not honored
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Master
Version: 3.10.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 3.11.z
Assignee: Tomáš Nožička
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-20 01:03 UTC by raffaele spazzoli
Modified: 2020-02-24 09:16 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-20 14:08:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description raffaele spazzoli 2018-10-20 01:03:43 UTC
Description of problem:

I have a deployment config with the following fragment in the pod template:

      dnsConfig:
        nameservers:
          - 172.31.248.117
        searches:
          - svc.cluster.local
          - cluster.local
      dnsPolicy: None

the does not get deployed with the following event/error at the deploymentConfig level (i.e. the replication controller is not even created):

Error creating deployer pod: Pod "httpd-4-deploy" is invalid: spec.dnsConfig: Required value: must provide `dnsConfig` when `dnsPolicy` is None


How reproducible: 100%


Steps to Reproduce:
1. oc new-app --name httpd registry.access.redhat.com/rhscl/httpd-24-rhel7~https://github.com/openshift/httpd-ex.git
2. oc patch dc httpd -p '{"spec":{"template":{"spec":{"dnsPolicy": "None", "dnsConfig":{"nameservers":["'$DNS1_IP'"], "searches":["svc.cluster.local","cluster.local"]}}}}}'


Actual results:
the deployment fails.


Expected results:
the deployment should succeed and the pod should be created with a custom /etc/resolv.conf

Comment 1 Andrew Block 2018-10-20 18:06:16 UTC
Validated this issue does appear in OCP 3.11.16

Switching to a Deployment does result in a successful deployment with DNS values injected

Comment 2 Seth Jennings 2018-10-22 14:31:25 UTC
Seems like this is a validation issue with DeploymentConfigs.  Sending to Master.

Comment 3 Tomáš Nožička 2018-11-30 16:46:45 UTC
https://github.com/openshift/origin/pull/21578

Comment 4 Tomáš Nožička 2018-12-03 13:07:36 UTC
https://github.com/openshift/origin/pull/21578

Comment 6 zhou ying 2018-12-21 03:09:01 UTC
The PR still open.

Comment 8 Daein Park 2019-03-01 11:07:45 UTC
It's valid on v3.11.69 now. When has this issue been fixed ? the errata is not updated when the enhancement is merged.

Comment 10 zhou ying 2019-03-14 09:22:32 UTC
The issue has fixed: 

[zhouying@dhcp-140-138 cucushift]$ oc get po httpd-3-wrd69 -o json |jq ".spec.dnsConfig"
{
  "nameservers": [
    "10.72.17.5"
  ],
  "searches": [
    "svc.cluster.local",
    "cluster.local"
  ]
}
[zhouying@dhcp-140-138 cucushift]$ oc get po httpd-3-wrd69 -o json |jq ".spec.dnsPolicy"
"None"
[zhouying@dhcp-140-138 cucushift]$ oc get po 
NAME            READY     STATUS      RESTARTS   AGE
httpd-1-build   0/1       Completed   0          25m
httpd-3-wrd69   1/1       Running     0          15m
[zhouying@dhcp-140-138 cucushift]$ oc version
oc v3.11.95
kubernetes v1.11.0+d4cacc0
openshift v3.11.95


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