学习资料来源于官方英文文档与《开源容器云OpenShift》一书,因为刚开始学习,不确定博客的正确性,以下内容仅供参考。
官方文档推荐开启SELINUX,否则会导致安装失败。 修改/etc/selinux/config
SELINUX=enforcing
SELINUXTYPE=targeted
# yum install -y docker-1.12.6
# systemctl stop firewalld
# systemctl disable firewalld
# systemctl enable docker
# systemctl start docker
# systemctl is-active docker
# docker version
# hostnamectl set-hostname master
192.168.121.133 master
我选择的是openshift-origin-server-v3.6.0-c4dd4cf-linux-64bit.tar.gz。
可从openshift/origin的github上找到各个版本的release包。
将openshift-origin-server-v3.6.0-c4dd4cf-linux-64bit.tar.gz拷贝到主机的/opt目录下。
# tar zxvf openshift-origin-server-v3.6.0-c4dd4cf-linux-64bit.tar.gz
# ln -s openshift-origin-server-v3.6.0-c4dd4cf-linux-64bit /opt/openshift
PATH=$PATH:/opt/openshift
#不加login登录会有点问题
export KUBECONFIG=/opt/openshift/openshift.local.config/master/admin.kubeconfig
export CURL_CA_BUNDLE=/opt/openshift/openshift.local.config/master/ca.crt
# source /etc/profile
# openshift version
# cd /opt/openshift
# openshift start
这里没有采用后台的方式启动openshift,所以会实时打印日志。
浏览器输入https://masterip:8443。 如果提示证书不可信,忽略并继续。
使用用户dev密码dev登录。
这里显示了我之前使用dev建立的两个工程,可以点击create project建立新工程。 界面与kubernetes的dashboard较像,但功能比其强大。