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.
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
I believe that both have to be there for backwards compatability. @jtan, please confirm.
Ben is correct they both appear for backwards compatibility. I am not sure how to remove the deprecated fields...
It is unfortunate but both need to be present
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?
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
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
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 ?
@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
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 ?
@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?
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
https://github.com/openshift/openshift-ansible/pull/8216
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
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