1: 先下载openshift 的安装包:https://pan.baidu.com/s/1OYhuaMJ_goa4DGZnU8GVcQ (取官网安装也可以,但是还是这个link 好用).
2: 安装docker, 我的docker 已经安装好了
3: 启动docker: systemctl start docker
4: 设置开机启动: systemctl enable docker.
5 将下载下来的openshift安装包放到/opt目录下
mv openshift-origin-server-v1.4.1-3f9807a-linux-64bit.tar.gz /opt
6.解压
cd /opt
tar -zxvf openshift-origin-server-v1.4.1-3f9807a-linux-64bit.tar.gz
7.目录太长,创建一个软链接
ln -s openshift-origin-server-v1.4.1+3f9807a-linux-64bit /opt/openshift
8.加到环境变量,并生效
vim /etc/profile
PATH=$PATH:/opt/openshift/
source /etc/profile
9.验证openshift环境变量是否配置好
openshift version
[root@test3 sysconfig]# openshift version
openshift v1.4.1+3f9807a
kubernetes v1.4.0+776c994
etcd 3.1.0-rc.0
10.启动
cd /opt/openshift
openshift start
启动后控制台如果不是一直打印报错日志就表示启动完成。
11.chrome浏览器中验证
登入密码是dev /dev
4: 注意,这个openshift/hello-openshift 这个image 在docker 里面没有找到:docker image 没有发现,还是先pull 一下:
docker search openshift
docker pull openshift/hello-openshift
然后docker images 就发现了:
[root@test3 sysconfig]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu-ansible latest 3c0c9557af36 3 months ago 242MB
ubuntu-ssh-20190622 latest af84d755fccd 3 months ago 240MB
ubuntu-ssh-20190622 ansible e91bf9461302 3 months ago 240MB
ubuntu latest 4c108a37151f 3 months ago 64.2MB
busybox latest e4db68de4ff2 3 months ago 1.22MB
httpd latest e77c77f17b46 3 months ago 140MB
openshift/hello-openshift latest 7af3297a3fb4 17 months ago 6.09MB
---
OK, 找到这个image 就出现create 的画面,一般不用全部填满,然后create, 就出现:
然后点contunue to overview:
在server 上可以看到docker container list:
root@test3 sysconfig]# docker container ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8ee1d67ece42 openshift/hello-openshift "/hello-openshift" About an hour ago Up About an hour k8s_hello-openshift.1ea1e6ca_hello-openshift-1-dw7j5_global_11114715-e192-11e9-a2dc-525400e21bea_09c8047a
5f7af76c9832 openshift/origin-pod:v1.4.1 "/pod" About an hour ago Up About an hour k8s_POD.488321c1_hello-openshift-1-dw7j5_global_11114715-e192-11e9-a2dc-525400e21bea_96580cdc