Openshift网络插件动态切换
Openshift 3.11版本
Openshift SDN网络插件ovs-subnet 与 ovs-multitenant切换
- 更改节点上的networkPluginName的配置
- master节点:
/etc/origin/master/master-config.yaml
- node节点:
/etc/origin/node/node-config.yaml
- 将networkPluginName中的
redhat/openshift-ovs-subnet
换成redhat/openshift-ovs-multitenant
,或者反过来。1
2$ ansible all -m shell -a 'sed -i "s/openshift-ovs-subnet/openshift-ovs-multitenant/g" /etc/origin/node/node-config.yaml'
$ ansible masters -m shell -a 'sed -i "s/openshift-ovs-subnet/openshift-ovs-multitenant/g" /etc/origin/master/master-config.yaml'- 重启master节点上的origin-master-api和origin-master-controllers服务
1
2$ ansible masters -m shell -a 'master-restart api' -f 1
$ ansible masters -m shell -a 'master-restart controllers' -f 1- 停止节点上的origin-node服务
1
$ ansible all -m service -a 'name=origin-node state=stopped'
- 在所有节点上重启Openshift SDN服务
1
$ oc delete pod --all -n openshift-sdn
- 在所有节点上重启origin-node服务
1
$ ansible all -m service -a 'name=origin-node state=started'
- 如果是从openshift sdn插件切换到第三方插件,需要清空将openshit sdn的特性
1
2
3$ oc delete clusternetwork --all
$ oc delete hostsubnets --all
$ oc delete netnamespaces --all- 检查VNIDs
1
$ oc get netnamespace
Openshift SDN网络插件ovs-multitenant 切换到 ovs-networkpolicy
- 下载切换脚本并更改执行权限
1 | $ curl -O https://raw.githubusercontent.com/openshift/origin/master/contrib/migration/migrate-network-policy.sh |
- 执行脚本,openshift使用cluster-admin权限的用户
1 | $ ./migrate-network-policy.sh |
Openshift 3.9版本
Openshift SDN网络插件ovs-subnet 与 ovs-multitenant切换
- 更改节点上的networkPluginName的配置
- master节点:
/etc/origin/master/master-config.yaml
- node节点:
/etc/origin/node/node-config.yaml
- 将networkPluginName中的
redhat/openshift-ovs-subnet
换成redhat/openshift-ovs-multitenant
,或者反过来。1
2$ ansible all -m shell -a 'sed -i "s/openshift-ovs-subnet/openshift-ovs-multitenant/g" /etc/origin/node/node-config.yaml'
$ ansible masters -m shell -a 'sed -i "s/openshift-ovs-subnet/openshift-ovs-multitenant/g" /etc/origin/master/master-config.yaml'- 重启master节点上的origin-master-api和origin-master-controllers服务
1
2$ ansible masters -m service -a 'name=origin-master-api state=restarted' -f 1
$ ansible masters -m service -a 'name=origin-master-controllers state=restarted' -f 1- 停止节点上的origin-node服务
1
$ ansible all -m service -a 'name=origin-node state=stopped'
- 在所有节点上重启openvswitch服务
1
$ ansible all -m service -a 'name=openvswitch state=restarted'
- 在所有节点上重启origin-node服务
1
$ ansible all -m service -a 'name=origin-node state=started'
- 如果是从openshift sdn插件切换到第三方插件,需要清空将openshit sdn的特性
1
2
3$ oc delete clusternetwork --all
$ oc delete hostsubnets --all
$ oc delete netnamespaces --all- 检查VNIDs
1
$ oc get netnamespace
Openshift SDN网络插件ovs-multitenant 切换到 ovs-networkpolicy
- 下载切换脚本并更改执行权限
1 | $ curl -O https://raw.githubusercontent.com/openshift/origin/master/contrib/migration/migrate-network-policy.sh |
- 执行脚本,openshift使用cluster-admin权限的用户
1 | $ ./migrate-network-policy.sh |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Michael Blog!
评论