openshift iso 制作

制作iso过程文档

制作openshift iso

Fedora发行版制作的工具主要有revisor和pungi两种;
revisor是一个图形化的工具,也可用命令行,但是经常会有bug,而且比较臃肿,感觉是给初级用户用的;
pungi是Fedora官方制作(或叫spin)发行版的工具,命令行,总共也就4、5个Python文件;
下面是使用 pungi来制作的iso

安装pungi

以下都是环境都是基于centos7

1
2
3
4
5
6
7
8
9
## 安装epel repo
yum install -y epel-release
## 安装elrepo
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
## 安装 pungi
yum install -y pungi hfsplus-tools kmod-hfs kmod-hfsplus docker

使用pungi build iso

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[root@localhost kolla-iso]# git clone http://gitlab.sh.99cloud.net/zhubingbing/openshift-iso.git
[root@localhost kolla-iso]# cd openshif-iso
[root@localhost kolla-iso]# ls
build.sh cobbler grub.cfg isolinux.cfg ks.cfg openshift os_ks.cfg README.md
## 这些包自己预先准备好,因为过大就没放在github上面,路径是存在 openshif-iso/openshift/目录下面,如果没有这个目录自己建立
[root@localhost kolla-iso]# ls openshift/
centos-openshift-origin.tar docker-registry.tar openshift-ansible.tar.gz openshift-package.tar registry.tar
[root@localhost openshift]# du -h openshift/
1.8G .
[root@localhost kolla-iso]# ./build.sh cobbler
Sending build context to Docker daemon 34.43 MB
Step 1 : FROM centos
---> 36540f359ca3
Step 2 : RUN yum install -y epel-release
[root@localhost kolla-iso] ./build //等待10几分钟iso就build好了
ls /root/kolla-iso/Ocata/x86_64/iso/CentOS-DVD-x86_64-Ocata.iso

build.sh代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash -e
case $1 in
'')
pungi --name=CentOS --ver=Ocata -c ks.cfg --isfinal --nosource --nodebuginfo --force -G -C -B
rsync -a isolinux.cfg Ocata/x86_64/os/isolinux/
rsync -a os_ks.cfg Ocata/x86_64/os/images/ks.cfg
mount Ocata/x86_64/os/images/efiboot.img /mnt
rsync -a grub.cfg /mnt/EFI/BOOT/
rsync -a grub.cfg Ocata/x86_64/os/EFI/BOOT/
umount /mnt
rm -f Ocata/x86_64/os/images/macboot.img
mkdir Ocata/x86_64/os/extras
rsync -a cobbler/init.sh Ocata/x86_64/os/extras
rsync -a cobbler/cobbler.tar Ocata/x86_64/os/extras
rsync -a openshift/registry.tar Ocata/x86_64/os/extras
rsync -a openshift/docker-registry.tar Ocata/x86_64/os/extras
rsync -a openshift/openshift-ansible.tar.gz Ocata/x86_64/os/extras
rsync -a openshift/openshift-package.tar Ocata/x86_64/os/extras
pungi --name=CentOS --ver=Ocata -c ks.cfg --isfinal --nosource --nodebuginfo --force -I
;;
"cobbler" )
docker build -t cobbler cobbler/build/; docker save cobbler > cobbler/cobbler.tar
;;
"clean")
rm -rf centos centos-extras docker epel logs ourtree work ocata Ocata cobbler/cobbler.tar
;;
esac

测试ISO

使用openshift iso安装部署节点

设置virtualbox虚拟机从光盘启动

虚拟机配置:2c 4g 40g

注释 注释

使用iso安装openshit部署节点

使用上下键选择安装openshift, 按下table键设置ip地址,确认(enter)开始安装

注释

安装完成确认3件事

  1. registry 是否正常启动

  2. cobbler 是否正常

  3. openshift yum源是否正常

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
### cobbler 容器和registry容器正常启动
[root@control01 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e01bced0a610 registry:2 "/entrypoint.sh /etc/" 28 seconds ago Up 26 seconds 0.0.0.0:4000->5000/tcp registry
b651bdf9c0c2 cobbler "/usr/bin/supervisord" 2 minutes ago Up 2 minutes cobbler
### 检查registry里面镜像是否正常
[root@control01 openshift]# pwd
/registry/docker/registry/v2/repositories/openshift
[root@control01 openshift]# ls
cockpit origin-deployer origin-docker-registry origin-haproxy-router origin-metrics-cassandra origin-metrics-hawkular-metrics origin-metrics-heapster origin-pod
### 检查openshift yum源是否可以用
[root@control01 openshift]# curl http://192.168.56.100:81/openshift-package/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Index of /openshift-package</title>
</head>
<body>
<h1>Index of /openshift-package</h1>
<table>
<tr><th valign="top"><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr>
<tr><th colspan="5"><hr></th></tr>
<tr><td valign="top"><img src="/icons/back.gif" alt="[PARENTDIR]"></td><td><a href="/">Parent Directory</a> </td><td>&nbsp;</td><td align="right"> - </td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="ansible-2.3.1.0-1.el7.noarch.rpm">ansible-2.3.1.0-1.el..&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right">5.7M</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="at-3.1.13-22.el7.x86_64.rpm">at-3.1.13-22.el7.x86..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 51K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="attr-2.4.46-12.el7.x86_64.rpm">attr-2.4.46-12.el7.x..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 66K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="avahi-libs-0.6.31-17.el7.x86_64.rpm">avahi-libs-0.6.31-17..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 61K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="bash-completion-2.1-6.el7.noarch.rpm">bash-completion-2.1-..&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right"> 85K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="bc-1.06.95-13.el7.x86_64.rpm">bc-1.06.95-13.el7.x8..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">115K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="bridge-utils-1.5-9.el7.x86_64.rpm">bridge-utils-1.5-9.e..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 32K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="ceph-common-0.94.5-1.el7.x86_64.rpm">ceph-common-0.94.5-1..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">6.2M</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="conntrack-tools-1.4.4-3.el7_3.x86_64.rpm">conntrack-tools-1.4...&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">186K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="cryptsetup-1.7.2-1.el7.x86_64.rpm">cryptsetup-1.7.2-1.e..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">124K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="cups-client-1.6.3-26.el7.x86_64.rpm">cups-client-1.6.3-26..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">149K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="cups-libs-1.6.3-26.el7.x86_64.rpm">cups-libs-1.6.3-26.e..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">356K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="ed-1.9-4.el7.x86_64.rpm">ed-1.9-4.el7.x86_64.rpm</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 72K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="epel-release-7-9.noarch.rpm">epel-release-7-9.noa..&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right"> 14K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="etcd-3.1.9-1.el7.x86_64.rpm">etcd-3.1.9-1.el7.x86..&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right">7.3M</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="gdisk-0.8.6-5.el7.x86_64.rpm">gdisk-0.8.6-5.el7.x8..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">187K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="glusterfs-fuse-3.7.9-12.el7.centos.x86_64.rpm">glusterfs-fuse-3.7.9..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">109K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="gssproxy-0.4.1-13.el7.x86_64.rpm">gssproxy-0.4.1-13.el..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 87K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="iptables-services-1.4.21-17.el7.x86_64.rpm">iptables-services-1...&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right"> 50K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="iscsi-initiator-utils-6.2.0.873-35.el7.x86_64.rpm">iscsi-initiator-util..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">417K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="iscsi-initiator-utils-iscsiuio-6.2.0.873-35.el7.x86_64.rpm">iscsi-initiator-util..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 85K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="keyutils-1.5.8-3.el7.x86_64.rpm">keyutils-1.5.8-3.el7..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 54K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libbasicobjects-0.1.1-27.el7.x86_64.rpm">libbasicobjects-0.1...&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 25K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libcollection-0.6.2-27.el7.x86_64.rpm">libcollection-0.6.2-..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 41K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libicu-50.1.2-15.el7.x86_64.rpm">libicu-50.1.2-15.el7..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">6.9M</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libini_config-1.3.0-27.el7.x86_64.rpm">libini_config-1.3.0-..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 63K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libnetfilter_cthelper-1.0.0-9.el7.x86_64.rpm">libnetfilter_cthelpe..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 18K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libnetfilter_cttimeout-1.0.0-6.el7.x86_64.rpm">libnetfilter_cttimeo..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 18K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libnetfilter_queue-1.0.2-2.el7.x86_64.rpm">libnetfilter_queue-1..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 23K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libnfsidmap-0.25-15.el7.x86_64.rpm">libnfsidmap-0.25-15...&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 47K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libpath_utils-0.2.1-27.el7.x86_64.rpm">libpath_utils-0.2.1-..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 27K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libref_array-0.1.5-27.el7.x86_64.rpm">libref_array-0.1.5-2..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 26K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libtalloc-2.1.6-1.el7.x86_64.rpm">libtalloc-2.1.6-1.el..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 34K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libtevent-0.9.28-1.el7.x86_64.rpm">libtevent-0.9.28-1.e..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 34K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libtirpc-0.2.4-0.8.el7_3.x86_64.rpm">libtirpc-0.2.4-0.8.e..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 88K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="libverto-tevent-0.2.5-4.el7.x86_64.rpm">libverto-tevent-0.2...&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">9.0K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="m4-1.4.16-10.el7.x86_64.rpm">m4-1.4.16-10.el7.x86..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">256K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="mailx-12.5-12.el7_0.x86_64.rpm">mailx-12.5-12.el7_0...&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">244K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="nfs-utils-1.3.0-0.33.el7_3.x86_64.rpm">nfs-utils-1.3.0-0.33..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">377K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="openvswitch-2.6.1-3.git20161206.el7.x86_64.rpm">openvswitch-2.6.1-3...&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">4.9M</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="origin-1.5.1-1.el7.x86_64.rpm">origin-1.5.1-1.el7.x..&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right"> 35M</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="origin-clients-1.5.1-1.el7.x86_64.rpm">origin-clients-1.5.1..&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right"> 16M</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="origin-docker-excluder-1.5.1-1.el7.noarch.rpm">origin-docker-exclud..&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right">6.1K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="origin-excluder-1.5.1-1.el7.noarch.rpm">origin-excluder-1.5...&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right">6.1K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="origin-master-1.5.1-1.el7.x86_64.rpm">origin-master-1.5.1-..&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right">9.2K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="origin-node-1.5.1-1.el7.x86_64.rpm">origin-node-1.5.1-1...&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">7.0K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="origin-sdn-ovs-1.5.1-1.el7.x86_64.rpm">origin-sdn-ovs-1.5.1..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">3.1M</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="patch-2.7.1-8.el7.x86_64.rpm">patch-2.7.1-8.el7.x8..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">110K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="psmisc-22.20-11.el7.x86_64.rpm">psmisc-22.20-11.el7...&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">141K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="python-keyczar-0.71c-2.el7.noarch.rpm">python-keyczar-0.71c..&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right">218K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="python-rados-0.94.5-1.el7.x86_64.rpm">python-rados-0.94.5-..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 38K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="python-rbd-0.94.5-1.el7.x86_64.rpm">python-rbd-0.94.5-1...&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 28K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="python2-ecdsa-0.13-4.el7.noarch.rpm">python2-ecdsa-0.13-4..&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right"> 83K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="python2-paramiko-1.16.1-2.el7.noarch.rpm">python2-paramiko-1.1..&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right">258K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="python2-pyasn1-0.1.9-7.el7.noarch.rpm">python2-pyasn1-0.1.9..&gt;</a></td><td align="right">2017-07-23 14:19 </td><td align="right">100K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="quota-4.01-14.el7.x86_64.rpm">quota-4.01-14.el7.x8..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">179K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="quota-nls-4.01-14.el7.noarch.rpm">quota-nls-4.01-14.el..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 90K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="redhat-lsb-core-4.1-27.el7.centos.1.x86_64.rpm">redhat-lsb-core-4.1-..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 38K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_64.rpm">redhat-lsb-submod-se..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 15K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="repodata/">repodata/</a> </td><td align="right">2017-07-23 14:24 </td><td align="right"> - </td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="rpcbind-0.2.0-38.el7_3.1.x86_64.rpm">rpcbind-0.2.0-38.el7..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 59K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="socat-1.7.2.2-5.el7.x86_64.rpm">socat-1.7.2.2-5.el7...&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">255K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="spax-1.5.2-13.el7.x86_64.rpm">spax-1.5.2-13.el7.x8..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right">260K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="tcp_wrappers-7.6-77.el7.x86_64.rpm">tcp_wrappers-7.6-77...&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 78K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="time-1.7-45.el7.x86_64.rpm">time-1.7-45.el7.x86_..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 30K</td><td>&nbsp;</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="tuned-profiles-origin-node-1.5.1-1.el7.x86_64.rpm">tuned-profiles-origi..&gt;</a></td><td align="right">2017-07-23 10:05 </td><td align="right"> 11K</td><td>&nbsp;</td></tr>
<tr><th colspan="5"><hr></th></tr>
</table>

到现在部署节点已经安装完毕;yum 源监听的是81端口,registry 监听的是4000端口

使用cobbler 安装node节点

设置虚拟机从pxe启动

在virtulbox要注意的一点是,要关闭virtulbox自带的dhcp网络模式使用host-only

注释 注释 注释

开始安装node节点

使用上下键选择安装centos7, 按下table键设置ip地址,确认(enter)开始安装

注释

安装openshift

修改host文件

1
2
3
4
5
[root@control01 byo]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.100 control01
192.168.56.101 control02

设置inventory

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
[root@control01 byo]# vim /root/openshift-ansible/inventory/byo/hosts.simple
[OSEv3:children]
masters
nodes
etcd
[OSEv3:vars]
ansible_ssh_user=root
openshift_deployment_type=origin
openshift_master_cluster_hostname=control02
openshif_release=v1.5
#### 注意这个all-in-one本来不该设置的,但是oepeshift内部使用域名访问
openshift_master_cluster_method=native
openshift_master_cluster_public_hostname=192.168.56.101
openshift_docker_options="-l warn --ipv6=false"
openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}]
openshift_additional_repos=[{'id': 'openshift-origin-local', 'name': 'OpenShift Origin', 'baseurl': 'http://192.168.56.100:81/openshift-package', 'enabled': 1, 'gpgcheck': 0}]
openshift_docker_additional_registries=192.168.56.100:4000
openshift_docker_insecure_registries=0.0.0.0/0
openshift_examples_modify_imagestreams=true
openshift_cockpit_deployer_prefix=192.168.56.100:4000/openshift/
openshift_cockpit=192.168.56.100:4000/openshift/cockpit/kubernetes
openshift_disable_check=memory_availability,disk_availability,package_version,package_availability,package_update,docker_image_availability,docker_storage_driver,docker_storage
[masters]
control02
[etcd]
control02
[nodes]
control02 openshift_schedulable=true openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
### 测试ansible是否ok
[root@control01 byo]# ansible -i hosts.simple all -m ping
control02 | SUCCESS => {
"changed": false,
"ping": "pong"
}
### 安装
[root@control01 ~]# ansible-playbook ~/openshift-ansible/playbooks/byo/config.yml -i /root/openshift-ansible/inventory/byo/hosts.simple
PLAY [Create initial host groups for localhost] ***************************************************************************************************************************************************************
TASK [include_vars] *******************************************************************************************************************************************************************************************
ok: [localhost]
PLAY [Populate config host groups] ****************************************************************************************************************************************************************************
TASK [Evaluate groups - g_etcd_hosts required] ****************************************************************************************************************************************************************
skipping: [localhost]
TASK [Evaluate groups - g_master_hosts or g_new_master_hosts required] ****************************************************************************************************************************************
skipping: [localhost]
TASK [openshift_excluder : Enable openshift excluder] *********************************************************************************************************************************************************
changed: [control02]
PLAY RECAP ****************************************************************************************************************************************************************************************************
control02 : ok=598 changed=160 unreachable=0 failed=0
localhost : ok=12 changed=0 unreachable=0 failed=0
[root@control01 ~]#
[root@control01 ~]#
[root@control01 ~]#
[root@control01 ~]# ssh control02
Warning: Permanently added 'control02,192.168.56.101' (ECDSA) to the list of known hosts.
Last login: Sun Jul 30 08:12:54 2017 from 192.168.56.100
[root@control02 ~]# kubectl get nodes
NAME STATUS AGE
control02 Ready 8m
[root@control02 ~]# kubectl get pods
NAME READY STATUS RESTARTS AGE
docker-registry-1-2p331 1/1 Running 0 2m
registry-console-1-1rvtj 1/1 Running 0 1m
router-1-fhf1x 1/1 Running 0 3m

安装结束,默认会安装registry、console、router

坚持原创技术分享,您的支持将鼓励我继续创作!