-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make node to auto detect openshift network plugin from master #9147
Make node to auto detect openshift network plugin from master #9147
Conversation
@openshift/networking @openshift/api-review PTAL |
API approved |
Maybe update |
Is that restriction worth it? I would prefer validation being just
restrictive enough for the core use case here, which is storing
cluster networks. If this value is primarily used to defend nodes
from mistakes, then restricting mutation makes it harder to fix those
mistakes.
|
Maybe validation isn't the right place to put it, but if you switch from a non-openshift-sdn plugin to an openshift-sdn plugin in a non-empty cluster, you're probably going to end up with a broken network. (And given that the previous plugin might have done anything to the nodes'/pods' networking configuration, and there's no way to force it to clean up after itself, there's no way we could make such a switchover work, other than by rebooting all the nodes.) But maybe the best solution is just to document "don't do that then". |
If the user deleted all the ClusterNetworks, would that be enough to On Mon, Jun 6, 2016 at 11:23 AM, Dan Winship [email protected]
|
We don't currently watch for changes on ClusterNetwork at all, but even if we did, the HostSubnet and Pod records implicitly reference the ClusterNetwork too (since they contain IPs allocated out of the ClusterNetwork range), so you'd have to delete them too. |
While reviewing QE test cases, I realized a bunch of issues related to ClusterNetwork:
To alleviate some of these problems, I was thinking to do:
@knobunc @eparis @danwinship @dcbw @smarterclayton reasonable? |
It would be nice if we could make it clearer that those types are specific to openshift-sdn too, not origin-generic. (eg, we don't want to let people manually create a clusternetwork record if they aren't using openshift-sdn, because that wouldn't make any sense)
Agreed, I suggested that in the other bug too
Yes, I think. I was looking into something similar while working on the egress firewall stuff, and was surprised that kubernetes doesn't have any concept of singleton types... Maybe that's something we want to try to address upstream. |
On Tue, Jun 7, 2016 at 10:16 AM, Dan Winship [email protected]
Why not? Why would a third party plugin not be able to use cluster network
That's intentional, we're unlikely to add it.
|
No other plugin has wanted to; it would make them OpenShift-only as opposed to being able to work with kubernetes in general. I guess if origin itself created the ClusterNetwork record, then other plugins might want to consider using it to read their configuration. (But currently the ClusterNetwork gets created by the openshift-sdn master code, so if you're using an exec-based or CNI network plugin, then no ClusterNetwork record is going to get created, and there's no hook that would allow you to create it yourself.) HostSubnet is more clearly openshift-sdn-specific. Eg, it assumes that each node has a single pod subnet, which isn't compatible with some network plugins. |
I think my point is that the API objects are intended to be used to support On Tue, Jun 7, 2016 at 10:37 AM, Dan Winship [email protected]
|
84dea25
to
6155b62
Compare
@openshift/networking @openshift/api-review updated, PTAL |
if clusterNetwork.PluginName == "" { | ||
// Do not return error in this case | ||
glog.Warningf("either there is network plugin mismatch between OpenShift node(%q) and master or OpenShift master is running an older version where we did not persist plugin name", pluginName) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invert this condition and return earlier.
6155b62
to
15d00e6
Compare
@danwinship @dcbw @knobunc @smarterclayton updated, PTAL |
@@ -582,6 +573,23 @@ func (c *MasterConfig) GetRestStorage() map[string]rest.Storage { | |||
"clusterRoles": clusterRoleStorage, | |||
} | |||
|
|||
if sdnovs.IsOpenShiftNetworkPlugin(c.Options.NetworkConfig.NetworkPluginName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't do this - it's a breaking change when cluster config changes, and we don't do it. All storage should always be enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When user switches from openshift network plugin to third party plugin, oc get clusternetwork/hostsubnets provides stale info and it will be confusing(clusternetwork will show multitenant/subnet pluginName when they are using a different one). I didn't prefer to delete existing clusternetwork/hostsubnets because any unintentional typo in plugin name will wipe out the configuration.
This is similar to storage for builds, build endpoints are enabled based on user config.These REST endpoints are specific to our SDN and if users are not using our plugin they shouldn't care about these endpoints?
@smarterclayton
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately these have always been enabled, we cannot disable them
without admin intervention. With your code change, they would suddenly be
disabled when the admin upgraded. That violates our backwards API
guarantees, where we don't change / break the behavior of the API without
admin intervention.
For 1.3 I don't think disabling these is worth the time or effort, since
it's unlikely users would use them. If you want to make this better we
should document that users should delete stale resources when they change
plugins.
On Mon, Jun 13, 2016 at 3:13 PM, Ravi Sankar Penta <[email protected]
wrote:
In pkg/cmd/server/origin/master.go
#9147 (comment):@@ -582,6 +573,23 @@ func (c *MasterConfig) GetRestStorage() map[string]rest.Storage {
"clusterRoles": clusterRoleStorage,
}
- if sdnovs.IsOpenShiftNetworkPlugin(c.Options.NetworkConfig.NetworkPluginName) {
When user switches from openshift network plugin to third party plugin, oc
get clusternetwork/hostsubnets provides stale info and it will be
confusing(clusternetwork will show multitenant/subnet pluginName when they
are using a different one). I didn't prefer to delete existing
clusternetwork/hostsubnets because any unintentional typo in plugin name
will wipe out the configuration.
This is similar to storage for builds, build endpoints are enabled based
on user config.These REST endpoints are specific to our SDN and if users
are not using our plugin they shouldn't care about these endpoints?
@smarterclayton https://github.com/smarterclayton—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/openshift/origin/pull/9147/files/816de37bfe1ff6cef3fbf81df8096bffa2d06030..06546b65a4c9375014c5d3ee8b80056afd73b78d#r66849632,
or mute the thread
https://github.com/notifications/unsubscribe/ABG_p0s_pidYXnJUqVflXfqQ4RxmiwXrks5qLau8gaJpZM4Is66G
.
1e74669
to
ea57398
Compare
@danwinship @smarterclayton |
[test] |
Compile failure:
Changes look good, update that and once I see a green test I'll merge. |
Needs corresponding openshift-sdn pr openshift/openshift-sdn#318 for this to work. I will sync the new changes from openshift-sdn repo. |
ea57398
to
1c6ea24
Compare
[test] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/5007/) (Image: devenv-rhel7_4394) |
Please hold this for the rebase which is in the merge queue |
Master persists the pluginName and all nodes fetchs this info to detect network plugin mismatch.
Node config nodeConfig.NetworkPluginName is optional for openshift network plugin. If plugin is not specified, it will auto detect by looking at ClusterNetwork. If plugin is specified, we will validate both node and master are using same network plugin or not. nodeConfig.NetworkPluginName is not deprecated to support third party network plugins. We can't expect or enforce third party node network plugin to auto detect from master. When openshift network plugin is used, fix check to block node start when kubelet is enabled but not plugin and viceversa.
…etwork resource and node networkPluginName changes
1c6ea24
to
e4ef036
Compare
re[test] |
Evaluated for origin test up to e4ef036 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/5007/) |
[merge] |
Evaluated for origin merge up to e4ef036 |
Depends on openshift/openshift-sdn#318