簡介
本文檔介紹了在安裝程式中開啟更改預設網路橋接器,使其不與專用網路衝突,從而完成安裝的過程。
問題
預設套件docker bridge使用IP範圍172.18.0.0/16,這可能會干擾專用網路。載入安裝程式時,內容可能會從安裝程式無法路由到專用網路。您可以通過以下方式檢視此網橋:
ip address show
登入到安裝程式VM時。您也可以通過以下方式在docker中檢視此網橋:
docker network ls
其外觀應如下所示:
[root@rcdn-ccs-repo ~]# docker network ls
NETWORK ID NAME DRIVER SCOPE
eadee20d76ce bridge bridge local
3a009a3d7747 host host local
f4ca595dfac5 none null local
5b0dbc510082 suite bridge local
必要條件
1.部署安裝程式VM(ova或qcow2)時,您必須能夠登入該虛擬機器,因此,如果使用VMware,則在部署OVA時必須更改預設例項ID和主機名,並新增公鑰或密碼。
2.如果使用Openstack,只需傳遞一個金鑰。
解決方案
步驟1.登入安裝程式。
步驟2.通過以下方式斷開套件安裝程式容器與當前網橋的連線:
docker network disconnect suite suite-prod-mgmt
docker network disconnect suite suite-nginx
docker network disconnect suite suite-installer-ui
docker network disconnect suite suite-k8s-mgmt
步驟3.如果有任何其它容器連線到套件網橋,您必須以類似的方式斷開它們的連線。
步驟4.從網橋斷開所有容器後,必須通過以下方式移除網橋:
docker network rm suite
步驟5.現在,您必須建立一個與私有網路不衝突的同名但不同/16網路的新docker網橋。在此命令示例中,使用了192.168.0.0/16:
docker network create --driver=bridge --subnet=192.168.0.0/16 --gateway=192.168.0.1 suite
附註:它必須是/16網路且必須命名為套件。
步驟6.通過以下方式重新啟動安裝程式VM:
shutdown -r now
步驟7.重新登入到VM。
步驟8.通過以下方式驗證套件安裝程式的容器是否已啟動並正在運行:
docker ps
應如下所示:
[root@rcdn-ccs-repo ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8d437dab65b9 devhub-docker.cisco.com/multicloudsuite-release/suite-nginx:5.0.0-RC2.8 "/entrypoint.sh" 13 days ago Up 13 days 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp suite-nginx
6bbffff3c248 devhub-docker.cisco.com/multicloudsuite-release/suite-prod-mgmt:5.0.0-RC2.8 "/entrypoint.sh" 13 days ago Up 13 days 8080/tcp suite-prod-mgmt
515754611a28 devhub-docker.cisco.com/multicloudsuite-release/suite-k8s-mgmt:5.0.0-RC2.8 "/entrypoint.sh" 13 days ago Up 13 days 8080/tcp suite-k8s-mgmt
8cd9d0c6ddb4 devhub-docker.cisco.com/multicloudsuite-release/suite-installer-ui:5.0.0-RC2.8 "npm start" 13 days ago Up 13 days 8080/tcp suite-installer-ui
步驟9.然後,您可以驗證*NEW*套件網橋是否適用於以下情況:
docker network inspect suite
將*NEW* ip範圍作為IPv4地址時,應如下所示:
[root@rcdn-ccs-repo ~]# docker network inspect suite
[
{
"Name": "suite",
"Id": "5b0dbc51008296cccbc766cfd44da1ce95e2cc803fd208e28af60b7931737485",
"Created": "2019-02-14T20:41:25.323694587Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "192.168.0.0/16",
"Gateway": "192.168.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Containers": {
"515754611a28d25ad43cb028ca133755fe7fe97609efe62f142c77607167844b": {
"Name": "suite-k8s-mgmt",
"EndpointID": "9e9e3860e284548a8634eef0dfc208da26532a0d5f696ad60aba0edf9a05ba73",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "192.168.0.3/16",
"IPv6Address": ""
},
"6bbffff3c24848028c0ea9b4294dcf47e78486acdaa0895747adbaed93aee83a": {
"Name": "suite-prod-mgmt",
"EndpointID": "d3f7b14f0c5101df9a17ca857d7b6fb1bbbd47063d3538cdfcad982c01f120e0",
"MacAddress": "02:42:ac:12:00:04",
"IPv4Address": "192.168.0.4/16",
"IPv6Address": ""
},
"8cd9d0c6ddb4424af25898131b68d22ca531c954c032d345981a25c90e9a3777": {
"Name": "suite-installer-ui",
"EndpointID": "47bf559917bb044b4a06a1010685b2388a670c29979fa4201d922445f31da63e",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "192.168.0.2/16",
"IPv6Address": ""
},
"8d437dab65b9ec19307f194ed50201163c486f5f2aff5133d8ecd4a7c014a656": {
"Name": "suite-nginx",
"EndpointID": "1a445b1b0d7208921e29fd64605992b259c5d1071513434768ec39ca68509cd9",
"MacAddress": "02:42:ac:12:00:05",
"IPv4Address": "192.168.0.5/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]
步驟10。您應該可以從此處轉到https://<INSTALLER_VM_IP>並載入安裝程式,並且沒有專用/內部網路衝突。