Bug 1534779 - Default master config shows both clusterNetworks and clusterNetworkCIDR/hostSubnetLength values
Summary: Default master config shows both clusterNetworks and clusterNetworkCIDR/hostS...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 3.9.0
Hardware: All
OS: All
low
low
Target Milestone: ---
: 3.10.0
Assignee: Jacob Tanenbaum
QA Contact: Meng Bo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-15 23:36 UTC by Ravi Sankar
Modified: 2018-12-20 21:45 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: deprecated clusterNetworkCIDR/hostSubnetLength are defined in the ansible config for deploying openshift clusters Consequence: The deprecated fields clusterNetworkCIDR/hostSubnetLength appear in the master config of newly deployed clusters Fix: Remove the deprecated fields from the ansible playbook Result: Master config files for newly deployed clusters using the ansible playbook do not contain deprecated networking fields
Clone Of:
Environment:
Last Closed: 2018-12-20 21:10:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift openshift-ansible pull 8216 0 None closed Remove clusterNetworkCIDR/hostSubnetLength from default config 2020-06-21 17:55:42 UTC
Origin (Github) 18669 0 None None None 2018-03-19 19:49:56 UTC

Description Ravi Sankar 2018-01-15 23:36:43 UTC
Description of problem:
Launch a cluster using dind and check the 'networkConfig' section in openshift-master config. I do not expect to see deprecated 'clusterNetworkCIDR' and 'hostSubnetLength' fields. 

networkConfig:
  clusterNetworkCIDR: 10.128.0.0/14
  clusterNetworks:
  - cidr: 10.128.0.0/14
    hostSubnetLength: 9
  externalIPNetworkCIDRs: null
  hostSubnetLength: 9
  ingressIPNetworkCIDR: 172.29.0.0/16
  networkPluginName: redhat/openshift-ovs-multitenant
  serviceNetworkCIDR: 172.30.0.0/16

Version-Release number of selected component (if applicable):
oc v3.9.0-alpha.2+f23861b-56-dirty
kubernetes v1.9.1+a0ce1bc657

How reproducible:
Always 

Expected results:
Deprecated config fields should not be set.

Additional info:
I guess this is not a dind issue as it uses openshift CLI to generate master and node config.

Comment 1 Meng Bo 2018-01-16 02:38:09 UTC
It is not related to dind, the master-config.yaml was generated by 

#/usr/bin/openshift start master --master=https://${master_ip}:8443 --network-plugin=${network} --write-config=/etc/origin/master/

networkConfig:
  clusterNetworkCIDR: 10.128.0.0/14
  clusterNetworks:
  - cidr: 10.128.0.0/14
    hostSubnetLength: 9
  externalIPNetworkCIDRs: null
  hostSubnetLength: 9
  ingressIPNetworkCIDR: 172.29.0.0/16
  networkPluginName: redhat/openshift-ovs-networkpolicy
  serviceNetworkCIDR: 172.30.0.0/16

Comment 2 Ben Bennett 2018-01-17 21:10:07 UTC
I believe that both have to be there for backwards compatability.  @jtan, please confirm.

Comment 3 Jacob Tanenbaum 2018-01-18 18:58:59 UTC
Ben is correct they both appear for backwards compatibility. I am not sure how to remove the deprecated fields...

Comment 4 Jacob Tanenbaum 2018-01-18 20:24:23 UTC
It is unfortunate but both need to be present

Comment 5 Ravi Sankar 2018-01-18 20:40:42 UTC
Reopening, this seems odd. I have deprecated few fields in the openshift config before and I'm sure I didn't have to set the deprecated field. Is there a special case that needed this change?

I can think of these backward compatibility cases:

(1) We need to set both clusterNetworkCIDR and clusterNetworks in the ClusterNetwork resource (persisted in etcd) because we may have latest master but the nodes might be old which expects old format in etcd record.

(2) If we are running old master config with new master binary. As part of conversions, we need to set clusterNetworks from clusterNetworkCIDR/hostSubnetLength.

(3) New master config and old master code is not supported anyway.

(4) ?

Looks like this was done for https://github.com/openshift/origin/issues/16627 which I think will fall under case (2). Don't see why freshly created master config needs to set deprecated fields in this case?

Comment 6 openshift-github-bot 2018-03-26 15:02:18 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/824e85a2434361b5ba7967ec9c7634bbd7c26158
Remove requirement of having deprecated clusterNetworkCIDR/hostSubnetLength in master.networkConfig

Currently in order for openshift to start the first entry in clusterNetworks and the old clusterNetworkCIDR/hostSubnetLength have to match. Change it
so the older clusterNetworkCIDR/hostSubnetLength fields are no longer required.

Bug 1534779

Comment 8 Hongan Li 2018-04-16 05:54:31 UTC
Tested in atomic-openshift-3.9.20-1.git.0.ec1c3c7 but the master-config still contains older clusterNetworkCIDR/hostSubnetLength fields, see below:
networkConfig:
  clusterNetworkCIDR: 10.128.0.0/14
  clusterNetworks:
  - cidr: 10.128.0.0/14
    hostSubnetLength: 9
  externalIPNetworkCIDRs:
  - 0.0.0.0/0
  hostSubnetLength: 9
  networkPluginName: redhat/openshift-ovs-multitenant
  serviceNetworkCIDR: 172.30.0.0/16

After removing the field "clusterNetworkCIDR: 10.128.0.0/14" and "hostSubnetLength: 9" then failed to restart master service. see log:

Apr 16 01:47:32 qe-hongli-39-master-etcd-1 atomic-openshift-master-api[81051]: Invalid MasterConfig /etc/origin/master/master-config.yaml
Apr 16 01:47:32 qe-hongli-39-master-etcd-1 atomic-openshift-master-api[81051]: networkConfig.hostSubnetLength: Invalid value: 0x0: cannot set hostSubnetLength and clusterNetworks, please use clusterNetworks
Apr 16 01:47:32 qe-hongli-39-master-etcd-1 atomic-openshift-master-api[81051]: networkConfig.clusterNetworkCIDR: Invalid value: "": cannot set clusterNetworkCIDR and clusterNetworks, please use clusterNetworks

Comment 10 Hongan Li 2018-04-20 03:15:50 UTC
Tested in atomic-openshift-3.9.24-1.git.0.3359cb0 and get same error as above  https://bugzilla.redhat.com/show_bug.cgi?id=1534779#c8

@jtanenba, please help check if the PR fix it in 3.9 ?

Comment 11 Ravi Sankar 2018-04-20 17:02:48 UTC
@hongli
Fix was merged in 3.10 and this bug has incorrect target of 3.9 (I just updated to correct target release which is 3.10). This fix is nice to have, so we don't need to back-port to 3.9 release.
Please retest the fix on 3.10

Comment 12 Hongan Li 2018-04-24 09:20:43 UTC
Tested in openshift v3.10.0-0.27.0, the 'clusterNetworkCIDR' and 'hostSubnetLength' fields still exist in the default master-config.yaml, but the static master pods can be restarted and work well after removing those two fields now.

@Ravi, could you help to confirm if this as expected ?

Comment 13 Ravi Sankar 2018-04-24 18:31:06 UTC
@hongli
No, this is not expected behavior. Default master-config.yaml should not generate clusterNetworkCIDR/hostSubnetLength fields. May be this was set by openshift-ansible installer? 

@jtanenba Can you please take a look?

Comment 14 Hongan Li 2018-04-25 01:20:41 UTC
Yes, maybe it was set by openshift-ansible, not sure if need update this template: 
https://github.com/openshift/openshift-ansible/blob/c6bf86d667e9450546af6e8fdc053a63b93ed2f1/roles/openshift_control_plane/templates/master.yaml.v1.j2#L113

Comment 16 openshift-github-bot 2018-05-03 08:12:58 UTC
Commit pushed to master at https://github.com/openshift/openshift-ansible

https://github.com/openshift/openshift-ansible/commit/0e1058041ffadfdcaa6676ada9ff35d4fca37975
Remove clusterNetworkCIDR/hostSubnetLength from default config

clusterNetworkCIDR and hostSubnetLength have been deprecated in favor
of a clusterNetwork object that allows a cluster administrator to
specify multiple cidr ranges of different sizes.

bug 1534779
https://bugzilla.redhat.com/show_bug.cgi?id=1534779

Comment 18 Meng Bo 2018-06-27 08:15:37 UTC
Tested on ocp v3.10.9, the issue has been fixed.

networkConfig:
  clusterNetworks:
  - cidr: 10.128.0.0/14
    hostSubnetLength: 9
  externalIPNetworkCIDRs:
  - 0.0.0.0/0
  networkPluginName: redhat/openshift-ovs-networkpolicy
  serviceNetworkCIDR: 172.30.0.0/16


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