Tungsten Fabric(7):编译和打包

官方的contrail-dev-env在编译的过程中,需要到Junper内部的repo取包,这个我们是无法访问的。好在有tf-dev-env可以完成同样的工作。目前tf-dev-env只有master这一个分支,但还是可以编译指定的contrail-controller的branch。

前期准备

  • 因为编译过程中需要访问很多的网络资源,所以你需要保证编译用的主机访问网络不受限制(你懂的)
  • 我使用的云主机信息
CentOS Linux release 7.8.2003 (Core)
6核CPU,16G内存,320G硬盘

操作过程

  • 安装git
[root@guest ~]# yum install -y git
  • 获取tf-dev-env
[root@guest ~]# git clone https://github.com/tungstenfabric/tf-dev-env.git
Cloning into 'tf-dev-env'...
remote: Enumerating objects: 52, done.
remote: Counting objects: 100% (52/52), done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 3053 (delta 20), reused 34 (delta 2), pack-reused 3001
Receiving objects: 100% (3053/3053), 527.26 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1893/1893), done.
[root@guest ~]# 
  • 设置contrail-controller分支信息
[root@guest ~]# export GERRIT_BRANCH=R2003
[root@guest ~]# echo $GERRIT_BRANCH
R2003

这里选择R2003,可用的分支可以在这里去找

  • 运行run.sh
[root@guest ~]# tf-dev-env/run.sh 
...
[DONE]
There are stages available to run ./run.sh :
  build     - perform sequence of stages: fetch, configure, compile, package
              (if stage was run previously it be skipped)
  fetch     - sync TF git repos
  configure - fetch third party packages and install dependencies
  compile   - build TF binaries
  package   - package TF into docker containers (you can specify target container to build like container-vrouter)
  test      - run unittests
  freeze    - prepare tf-dev-env for pushing to container registry for future reuse by compressing contrail directory
  upload    - pushes tf-dev-env to container registry
For advanced usage You can now connect to the sandbox container by using:
  sudo docker exec -it tf-dev-sandbox bash
[root@guest ~]# 

此时可以发现多出了两个目录

[root@guest ~]# ll
total 44
-rw-r--r--.  1 root root 31259 Jul  2 00:54 build_02_07_2020__00_43_20.log
drwxr-xr-x. 24 root root  4096 Jul  2 00:50 contrail
drwxr-xr-x.  3 root root  4096 Jul  2 00:50 output
drwxr-xr-x.  8 root root  4096 Jul  2 00:43 tf-dev-env
[root@guest ~]# 

而且拉取的contrail-controller的分支就是指定的R2003

[root@guest ~]# cd contrail/controller/
[root@guest controller]# 
[root@guest controller]# git branch
* R2003
[root@guest controller]# 

还可以看到启动了两个docker,其实编译打包都是在sandbox这个docker里执行的

[root@guest ~]# docker ps
CONTAINER ID        IMAGE                                  COMMAND                  CREATED             STATUS              PORTS                    NAMES
20d72fad618b        localhost:5000/tf-dev-sandbox:latest   "/entrypoint.sh"         7 minutes ago       Up 7 minutes                                 tf-dev-sandbox
2b2562450334        registry:2                             "/entrypoint.sh /etc_"   14 minutes ago      Up 14 minutes       0.0.0.0:5000->5000/tcp   tf-dev-env-registry
  • 运行run.sh configure,这个没什么可说的
[root@guest ~]# tf-dev-env/run.sh configure
  • 运行run.sh compile,编出后面打包需要的rpm
[root@guest ~]# tf-dev-env/run.sh compile

编译好的rpm存放在

[root@guest ~]# docker exec -it tf-dev-sandbox bash
sandbox:~$ 
sandbox:~$ ll /root/contrail/RPMS/x86_64/
total 118420
-rwxr-xr-x. 1 root root     1600 Jul  2 01:45 contrail-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  5025844 Jul  2 01:46 contrail-analytics-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  9175948 Jul  2 01:46 contrail-config-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root   447216 Jul  2 01:45 contrail-config-openstack-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  5048492 Jul  2 01:46 contrail-control-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  5514360 Jul  2 01:46 contrail-dns-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  1442244 Jul  2 01:46 contrail-docs-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  2275320 Jul  2 01:46 contrail-k8s-cni-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root   326456 Jul  2 01:46 contrail-kube-manager-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  2320904 Jul  2 01:46 contrail-lib-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  2116492 Jul  2 01:46 contrail-mesos-cni-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root    86512 Jul  2 01:46 contrail-mesos-manager-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root   316300 Jul  2 01:12 contrail-nodemgr-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root    26476 Jul  2 01:46 contrail-nova-vif-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  7588936 Jul  2 01:46 contrail-test-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root    65268 Jul  2 01:46 contrail-utils-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root 17709204 Jul  2 01:03 contrail-vcenter-plugin-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  2903700 Jul  2 01:45 contrail-vrouter-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root 13603288 Jul  2 01:46 contrail-vrouter-agent-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  5727628 Jul  2 01:18 contrail-vrouter-dpdk-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root    19088 Jul  2 01:08 contrail-vrouter-dpdk-init-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root    11488 Jul  2 01:08 contrail-vrouter-init-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root   358444 Jul  2 01:45 contrail-vrouter-source-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root   299768 Jul  2 01:45 contrail-vrouter-utils-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  3275580 Jul  2 01:09 contrail-web-controller-2003-070220200100.x86_64.rpm
-rwxr-xr-x. 1 root root 29472676 Jul  2 01:08 contrail-web-core-2003-070220200100.x86_64.rpm
-rwxr-xr-x. 1 root root   398756 Jul  2 01:03 libcontrail-java-api-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  1674976 Jul  2 01:03 libcontrail-vijava-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root     8820 Jul  2 01:03 libcontrail-vrouter-java-api-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  1822696 Jul  2 01:45 python3-contrail-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  2052816 Jul  2 01:45 python-contrail-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root     7000 Jul  2 01:45 python-contrail-vrouter-api-2003-070220200100.el7.x86_64.rpm
-rwxr-xr-x. 1 root root    67100 Jul  2 01:46 python-opencontrail-vrouter-netns-2003-070220200100.el7.x86_64.rpm
sandbox:~$ 
  • 指定生成镜像的tag,运行run.sh package,开始打包docker镜像
[root@guest ~]# export CONTRAIL_CONTAINER_TAG=R2003-1
[root@guest ~]# tf-dev-env/run.sh compile

目前有报错

deployers: ERROR: Building contrail-openshift-ansible-deployer failed
deployers: ERROR: Failed to build some containers, see log files:
deployers: -rw-r--r--. 1 root root   4753 Jul  2 01:52 /root/contrail/contrail-deployers-containers/containers/build-contrail-deployers-base.log
deployers: -rw-r--r--. 1 root root  47991 Jul  2 02:09 /root/contrail/contrail-deployers-containers/containers/build-contrail-helm-deployer-src-openstack-helm-infra-tools-images-kubeadm-aio.log
deployers: -rw-r--r--. 1 root root    111 Jul  2 01:53 /root/contrail/contrail-deployers-containers/containers/build-contrail-helm-deployer-src-openstack-helm-tools-images-ceph-config-helper.log
deployers: -rw-r--r--. 1 root root    103 Jul  2 01:53 /root/contrail/contrail-deployers-containers/containers/build-contrail-helm-deployer-src-openstack-helm-tools-images-gate-utils.log
deployers: -rw-r--r--. 1 root root    104 Jul  2 01:58 /root/contrail/contrail-deployers-containers/containers/build-contrail-helm-deployer-src-openstack-helm-tools-images-openvswitch.log
deployers: -rw-r--r--. 1 root root 179162 Jul  2 02:08 /root/contrail/contrail-deployers-containers/containers/build-contrail-helm-deployer-src-openstack-helm-tools-images-vbmc.log
deployers: -rw-r--r--. 1 root root    285 Jul  2 02:09 /root/contrail/contrail-deployers-containers/containers/build-contrail-kolla-ansible-deployer.log
deployers: -rw-r--r--. 1 root root    293 Jul  2 02:10 /root/contrail/contrail-deployers-containers/containers/build-contrail-openshift-ansible-deployer.log
make: *** [deployers-only] Error 1

ERROR: There were failures. See logs for details.
[root@guest ~]# 

但是暂不影响和k8s集成所需的docker镜像

[root@guest ~]# docker images | grep contrail
localhost:5000/contrail-test-base                                                          R2003-1             dc94ab7cdbc4        16 minutes ago      1.46GB
contrail-test-base                                                                         R2003-1             dc94ab7cdbc4        16 minutes ago      1.46GB
localhost:5000/contrail-vcenter-plugin                                                     R2003-1             4d1b53b8ed9c        17 minutes ago      733MB
localhost:5000/contrail-vrouter-agent                                                      R2003-1             8ea9bf26a2b6        17 minutes ago      749MB
localhost:5000/contrail-vrouter-kernel-build-init                                          R2003-1             00b449c33d52        18 minutes ago      233MB
localhost:5000/contrail-controller-config-devicemgr                                        R2003-1             36dd0510ce82        18 minutes ago      824MB
localhost:5000/contrail-vrouter-agent-dpdk                                                 R2003-1             766cb02bab12        18 minutes ago      718MB
localhost:5000/contrail-vrouter-plugin-mellanox-init-ubuntu                                R2003-1             514a58c0cfc0        18 minutes ago      306MB
localhost:5000/contrail-controller-config-stats                                            R2003-1             cb6e6384edb9        18 minutes ago      516MB
localhost:5000/contrail-tor-agent                                                          R2003-1             5663f276b229        19 minutes ago      615MB
localhost:5000/contrail-controller-config-dnsmasq                                          R2003-1             14b5b6696015        19 minutes ago      516MB
localhost:5000/contrail-vcenter-manager                                                    R2003-1             cbe8a4070ac1        19 minutes ago      618MB
localhost:5000/contrail-vrouter-plugin-mellanox-init-redhat                                R2003-1             4e86f4bc5845        19 minutes ago      418MB
localhost:5000/contrail-controller-config-api                                              R2003-1             64198be15357        19 minutes ago      726MB
localhost:5000/contrail-openstack-ironic-notification-manager                              R2003-1             ad3fdbd86917        19 minutes ago      556MB
localhost:5000/contrail-nodemgr                                                            R2003-1             7c8ce2a21833        19 minutes ago      548MB
localhost:5000/contrail-tools                                                              R2003-1             4a58de4e1157        19 minutes ago      532MB
localhost:5000/contrail-openstack-neutron-init                                             R2003-1             139de65d0300        20 minutes ago      332MB
localhost:5000/contrail-kubernetes-kube-manager                                            R2003-1             c6506a9a3282        20 minutes ago      522MB
localhost:5000/contrail-mesosphere-mesos-manager                                           R2003-1             85ecbbba4167        20 minutes ago      520MB
localhost:5000/contrail-vcenter-fabric-manager                                             R2003-1             0913b743f63d        20 minutes ago      522MB
localhost:5000/contrail-kubernetes-cni-init                                                R2003-1             8c37731dda61        20 minutes ago      536MB
localhost:5000/contrail-vrouter-kernel-init                                                R2003-1             9debd99ba639        20 minutes ago      592MB
localhost:5000/contrail-status                                                             R2003-1             053becdfcc96        20 minutes ago      517MB
localhost:5000/contrail-openstack-heat-init                                                R2003-1             f773ff87189c        20 minutes ago      331MB
localhost:5000/contrail-node-init                                                          R2003-1             958107e6c0c5        20 minutes ago      516MB
localhost:5000/contrail-mesosphere-cni-init                                                R2003-1             4aa9f78bddb7        20 minutes ago      535MB
localhost:5000/contrail-analytics-snmp-topology                                            R2003-1             64212ad329eb        20 minutes ago      604MB
localhost:5000/contrail-analytics-alarm-gen                                                R2003-1             fb8c26202fe9        20 minutes ago      604MB
localhost:5000/contrail-analytics-snmp-collector                                           R2003-1             0396fbd858cf        20 minutes ago      604MB
localhost:5000/contrail-analytics-query-engine                                             R2003-1             70b28a1f7ce1        20 minutes ago      604MB
localhost:5000/contrail-controller-control-control                                         R2003-1             dda2330759d7        20 minutes ago      639MB
localhost:5000/contrail-controller-webui-web                                               R2003-1             d57fd571f30c        20 minutes ago      552MB
localhost:5000/contrail-controller-config-svcmonitor                                       R2003-1             6ed98ee01210        20 minutes ago      657MB
localhost:5000/contrail-controller-config-schema                                           R2003-1             48eb2103f477        20 minutes ago      657MB
localhost:5000/contrail-controller-control-named                                           R2003-1             81de512b2575        20 minutes ago      616MB
localhost:5000/contrail-analytics-api                                                      R2003-1             71d783b2c602        20 minutes ago      604MB
localhost:5000/contrail-controller-webui-job                                               R2003-1             4644815fc33e        20 minutes ago      552MB
localhost:5000/contrail-analytics-collector                                                R2003-1             eee3605c6c95        20 minutes ago      604MB
localhost:5000/contrail-debug                                                              R2003-1             b8cc317a139d        20 minutes ago      303MB
localhost:5000/contrail-openstack-compute-init                                             R2003-1             38045ef0c5a7        20 minutes ago      303MB
localhost:5000/contrail-controller-control-dns                                             R2003-1             b175f7856a3a        20 minutes ago      616MB
localhost:5000/contrail-provisioner                                                        R2003-1             17c2946cf5a2        20 minutes ago      490MB
localhost:5000/contrail-vrouter-kernel-init-dpdk                                           R2003-1             475816285fd5        20 minutes ago      547MB
localhost:5000/contrail-k8s-manifests                                                      R2003-1             853707a5f63e        21 minutes ago      13.2MB
localhost:5000/contrail-helm-deployer-src-openstack-helm-tools-images-openvswitch          R2003-1             83569befdd79        21 minutes ago      256MB
localhost:5000/contrail-external-kafka                                                     R2003-1             eb9ae63317f0        21 minutes ago      667MB
localhost:5000/contrail-external-cassandra                                                 R2003-1             a125f8529c31        23 minutes ago      555MB
localhost:5000/contrail-analytics-base                                                     R2003-1             24abc71fa418        23 minutes ago      604MB
localhost:5000/contrail-controller-webui-base                                              R2003-1             33e737b27eb3        23 minutes ago      552MB
localhost:5000/contrail-controller-config-base                                             R2003-1             6e729f2ddf24        23 minutes ago      657MB
localhost:5000/contrail-external-rabbitmq                                                  R2003-1             d32e7ebb98ca        23 minutes ago      296MB
localhost:5000/contrail-controller-control-base                                            R2003-1             b4d961e2d9b2        24 minutes ago      616MB
localhost:5000/contrail-external-redis                                                     R2003-1             fc91fd6abd65        24 minutes ago      135MB
localhost:5000/contrail-external-stunnel                                                   R2003-1             0439b9a47ba7        24 minutes ago      360MB
localhost:5000/contrail-external-haproxy                                                   R2003-1             abfddb45920d        24 minutes ago      116MB
localhost:5000/contrail-external-zookeeper                                                 R2003-1             a8598b491e51        24 minutes ago      288MB
localhost:5000/contrail-vrouter-base                                                       R2003-1             8dbf1e855e06        24 minutes ago      547MB
localhost:5000/contrail-external-rsyslogd                                                  R2003-1             fc48a7b13885        24 minutes ago      304MB
localhost:5000/contrail-base                                                               R2003-1             f3fc572acb90        25 minutes ago      490MB
localhost:5000/contrail-helm-deployer-src-openstack-helm-tools-images-gate-utils           R2003-1             33eb4a9af782        26 minutes ago      87.5MB
localhost:5000/contrail-helm-deployer-src-openstack-helm-tools-images-ceph-config-helper   R2003-1             46b72bc79e5d        26 minutes ago      264MB
localhost:5000/contrail--root-contrail-tf-charms                                           R2003-1             909a5d867d83        26 minutes ago      4.35MB
localhost:5000/contrail-general-base                                                       R2003-1             4a11bf916d67        27 minutes ago      278MB
[root@guest ~]# 

这些镜像也都被推入本地仓库

[root@guest ~]# curl -X GET http://localhost:5000/v2/_catalog | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2052    0  2052    0     0   148k      0 --:--:-- --:--:-- --:--:--  166k
{
    "repositories": [
        "contrail--root-contrail-tf-charms",
        "contrail-analytics-alarm-gen",
        "contrail-analytics-api",
        "contrail-analytics-base",
        "contrail-analytics-collector",
        "contrail-analytics-query-engine",
        "contrail-analytics-snmp-collector",
        "contrail-analytics-snmp-topology",
        "contrail-base",
        "contrail-controller-config-api",
        "contrail-controller-config-base",
        "contrail-controller-config-devicemgr",
        "contrail-controller-config-dnsmasq",
        "contrail-controller-config-schema",
        "contrail-controller-config-stats",
        "contrail-controller-config-svcmonitor",
        "contrail-controller-control-base",
        "contrail-controller-control-control",
        "contrail-controller-control-dns",
        "contrail-controller-control-named",
        "contrail-controller-webui-base",
        "contrail-controller-webui-job",
        "contrail-controller-webui-web",
        "contrail-debug",
        "contrail-external-cassandra",
        "contrail-external-haproxy",
        "contrail-external-kafka",
        "contrail-external-rabbitmq",
        "contrail-external-redis",
        "contrail-external-rsyslogd",
        "contrail-external-stunnel",
        "contrail-external-zookeeper",
        "contrail-general-base",
        "contrail-helm-deployer-src-openstack-helm-tools-images-ceph-config-helper",
        "contrail-helm-deployer-src-openstack-helm-tools-images-gate-utils",
        "contrail-helm-deployer-src-openstack-helm-tools-images-openvswitch",
        "contrail-k8s-manifests",
        "contrail-kubernetes-cni-init",
        "contrail-kubernetes-kube-manager",
        "contrail-mesosphere-cni-init",
        "contrail-mesosphere-mesos-manager",
        "contrail-node-init",
        "contrail-nodemgr",
        "contrail-openstack-compute-init",
        "contrail-openstack-heat-init",
        "contrail-openstack-ironic-notification-manager",
        "contrail-openstack-neutron-init",
        "contrail-provisioner",
        "contrail-status",
        "contrail-tools",
        "contrail-tor-agent",
        "contrail-vcenter-fabric-manager",
        "contrail-vcenter-manager",
        "contrail-vcenter-plugin",
        "contrail-vrouter-agent",
        "contrail-vrouter-agent-dpdk",
        "contrail-vrouter-base",
        "contrail-vrouter-kernel-build-init",
        "contrail-vrouter-kernel-init",
        "contrail-vrouter-kernel-init-dpdk",
        "contrail-vrouter-plugin-mellanox-init-redhat",
        "contrail-vrouter-plugin-mellanox-init-ubuntu"
    ]
}

使用

  • 如果部署用的相关节点都方便和编译用的主机互通,那么可以直接使用编译机的registry作为contrail的镜像源
  • 如果不方便互通,那么需要打包后传回部署环境
    • 本地打包,在镜像里运行脚本
[root@guest ~]# docker exec -it tf-dev-sandbox bash
sandbox:~$ cat pa.sh
#!/bin/bash


set -e

LOCAL_REGISTRY_URL=localhost:5000
IMAGE_TAG=R2003-1
COMMON_IMAGES="contrail-node-init contrail-status contrail-nodemgr contrail-external-cassandra contrail-external-zookeeper contrail-external-kafka contrail-external-redis contrail-external-rabbitmq contrail-external-rsyslogd contrail-provisioner"
ANALYTICS_IMAGES="contrail-analytics-query-engine contrail-analytics-api contrail-analytics-collector contrail-analytics-snmp-collector contrail-analytics-snmp-topology contrail-analytics-alarm-gen "
CONTROL_IMAGES="contrail-controller-control-control contrail-controller-control-dns contrail-controller-control-named contrail-controller-config-api contrail-controller-config-devicemgr contrail-controller-config-schema contrail-controller-config-svcmonitor contrail-controller-config-stats contrail-controller-config-dnsmasq"
WEBUI_IMAGES="contrail-controller-webui-job contrail-controller-webui-web "
K8S_IMAGES="contrail-kubernetes-kube-manager contrail-kubernetes-cni-init "
VROUTER_IMAGES="contrail-vrouter-kernel-init contrail-vrouter-agent"



IMAGES=$COMMON_IMAGES" "$ANALYTICS_IMAGES" "$CONTROL_IMAGES" "$WEBUI_IMAGES" "$K8S_IMAGES" "$VROUTER_IMAGES

images_str=''
for image in $IMAGES
do
   echo "===add image: "$image
   images_str="$images_str $LOCAL_REGISTRY_URL/$image:$IMAGE_TAG"
done

echo $images_str


docker save $images_str -o R2003-1.tar
gzip R2003-1.tar
sandbox:~$ chmod +x pa.sh
sandbox:~$ 
sandbox:~$ ./pa.sh 


sandbox:~$ ll  | grep R2003
-rw-------.  1 root root 1300286917 Jul  2 03:36 R2003-1.tar.gz
sandbox:~$
  • 传回到本地部署机,最好确认一下文件的md5,保证文件传输时候没有错误发生
[root@deploy ~]#  md5sum R2003-1.tar.gz
0aeccd058e6ffb0f06b01ffbfe2d6913  R2003-1.tar.gz
  • 解压缩还原为原来的tar文件
[root@deploy ~]# gzip -d R2003-1.tar.gz 
  • 加载镜像
[root@deploy ~]# docker load -i R2003-1.tar 

[root@deploy ~]# docker images | grep R2003-1
localhost:5000/contrail-vrouter-agent                                 R2003-1             8ea9bf26a2b6        6 hours ago         749MB
localhost:5000/contrail-controller-config-devicemgr                   R2003-1             36dd0510ce82        6 hours ago         824MB
localhost:5000/contrail-controller-config-stats                       R2003-1             cb6e6384edb9        6 hours ago         516MB
localhost:5000/contrail-controller-config-dnsmasq                     R2003-1             14b5b6696015        6 hours ago         516MB
localhost:5000/contrail-controller-config-api                         R2003-1             64198be15357        6 hours ago         726MB
localhost:5000/contrail-nodemgr                                       R2003-1             7c8ce2a21833        6 hours ago         548MB
localhost:5000/contrail-kubernetes-kube-manager                       R2003-1             c6506a9a3282        6 hours ago         522MB
localhost:5000/contrail-kubernetes-cni-init                           R2003-1             8c37731dda61        6 hours ago         536MB
localhost:5000/contrail-vrouter-kernel-init                           R2003-1             9debd99ba639        6 hours ago         592MB
localhost:5000/contrail-status                                        R2003-1             053becdfcc96        6 hours ago         517MB
localhost:5000/contrail-node-init                                     R2003-1             958107e6c0c5        6 hours ago         516MB
localhost:5000/contrail-analytics-snmp-topology                       R2003-1             64212ad329eb        6 hours ago         604MB
localhost:5000/contrail-analytics-alarm-gen                           R2003-1             fb8c26202fe9        6 hours ago         604MB
localhost:5000/contrail-analytics-snmp-collector                      R2003-1             0396fbd858cf        6 hours ago         604MB
localhost:5000/contrail-analytics-query-engine                        R2003-1             70b28a1f7ce1        6 hours ago         604MB
localhost:5000/contrail-controller-control-control                    R2003-1             dda2330759d7        6 hours ago         639MB
localhost:5000/contrail-controller-webui-web                          R2003-1             d57fd571f30c        6 hours ago         552MB
localhost:5000/contrail-controller-config-svcmonitor                  R2003-1             6ed98ee01210        6 hours ago         657MB
localhost:5000/contrail-controller-config-schema                      R2003-1             48eb2103f477        6 hours ago         657MB
localhost:5000/contrail-controller-control-named                      R2003-1             81de512b2575        6 hours ago         616MB
localhost:5000/contrail-controller-webui-job                          R2003-1             4644815fc33e        6 hours ago         552MB
localhost:5000/contrail-analytics-api                                 R2003-1             71d783b2c602        6 hours ago         604MB
localhost:5000/contrail-analytics-collector                           R2003-1             eee3605c6c95        6 hours ago         604MB
localhost:5000/contrail-controller-control-dns                        R2003-1             b175f7856a3a        6 hours ago         616MB
localhost:5000/contrail-provisioner                                   R2003-1             17c2946cf5a2        6 hours ago         490MB
localhost:5000/contrail-external-kafka                                R2003-1             eb9ae63317f0        6 hours ago         667MB
localhost:5000/contrail-external-cassandra                            R2003-1             a125f8529c31        6 hours ago         555MB
localhost:5000/contrail-external-rabbitmq                             R2003-1             d32e7ebb98ca        6 hours ago         296MB
localhost:5000/contrail-external-redis                                R2003-1             fc91fd6abd65        6 hours ago         135MB
localhost:5000/contrail-external-zookeeper                            R2003-1             a8598b491e51        6 hours ago         288MB
localhost:5000/contrail-external-rsyslogd                             R2003-1             fc48a7b13885        6 hours ago         304MB
[root@deploy ~]# 
  • 将这些镜像push到本地仓库
[root@deploy ~]# cat push.sh 
#!/bin/bash


set -e

ORIGINAL_REGISTRY_URL=localhost:5000
LOCAL_REGISTRY=192.168.122.79
IMAGE_TAG=R2003-1
COMMON_IMAGES="contrail-node-init contrail-status contrail-nodemgr contrail-external-cassandra contrail-external-zookeeper contrail-external-kafka contrail-external-redis contrail-external-rabbitmq contrail-external-rsyslogd contrail-pr"
ANALYTICS_IMAGES="contrail-analytics-query-engine contrail-analytics-api contrail-analytics-collector contrail-analytics-snmp-collector contrail-analytics-snmp-topology contrail-analytics-alarm-gen "
CONTROL_IMAGES="contrail-controller-control-control contrail-controller-control-dns contrail-controller-control-named contrail-controller-config-api contrail-controller-config-devicemgr contrail-controller-config-schema contrail-control"
WEBUI_IMAGES="contrail-controller-webui-job contrail-controller-webui-web "
K8S_IMAGES="contrail-kubernetes-kube-manager contrail-kubernetes-cni-init "
VROUTER_IMAGES="contrail-vrouter-kernel-init contrail-vrouter-agent"


IMAGES=$COMMON_IMAGES" "$ANALYTICS_IMAGES" "$CONTROL_IMAGES" "$WEBUI_IMAGES" "$K8S_IMAGES" "$VROUTER_IMAGES

for image in $IMAGES
do
  docker tag $ORIGINAL_REGISTRY_URL/$image:$IMAGE_TAG $LOCAL_REGISTRY/$image:$IMAGE_TAG
  docker push $LOCAL_REGISTRY/$image:$IMAGE_TAG
  docker rmi $ORIGINAL_REGISTRY_URL/$image:$IMAGE_TAG
done
[root@deploy ~]# 
[root@deploy ~]# 
[root@deploy ~]# ./push.sh 

部署

不多说了,参考这里。

你可能感兴趣的:(网络通信)