我安装的是Openshift Origin v3.7,以后版本的安装推荐按照官方文档做:https://docs.openshift.org/latest/getting_started/administrators.html#downloading-the-binary
cd /home/eos-paas/
wget http://192.168.199.230/m/openshift-origin-server-v3.7.0-alpha.1-fdbd3dc-linux-64bit.tar.gz
tar -xvzf openshift-origin-server-v3.7.0-alpha.1-fdbd3dc-linux-64bit.tar.gz
mv openshift-origin-server-v3.7.0-alpha.1-fdbd3dc-linux-64bit openshiftorigin
yum install -y docker
systemctl start docker
systemctl enable dockersystemctl stop firewalld
systemctl disable firewalldyum install -y git
vi /etc/hosts
加入 eos.mypaas.comvi /etc/profile
在文档最底下添加:
export PATH=/home/eos-paas/openshiftorigin:$PATHexport KUBECONFIG=/home/eos-paas/openshiftorigin/openshift.local.config/master/admin.kubeconfig
export CURL_CA_BUNDLE=/home/eos-paas/openshiftorigin/openshift.local.config/master/ca.crt
export IMAGESTREAMDIR=~/openshift-ansible/roles/openshift_examples/files/examples/v3.6/image-streams
export QSTEMPLATES=~/openshift-ansible/roles/openshift_examples/files/examples/v3.6/quickstart-templates
source /etc/profile
cd /home/eos-paas/openshiftorigin
sudo chmod +r /home/eos-paas/openshiftorigin/openshift.local.config/master/admin.kubeconfigvi /etc/sysconfig/docker
加入 –insecure-registry=172.30.0.0/16
cd /home/eos-paas/openshiftorigin
openshift start
-部署 docker registry
oadm registry –config=/home/eos-paas/openshiftorigin/openshift.local.config/master/admin.kubeconfig –service-account=registry部署 router
oc adm policy add-scc-to-user privileged system:serviceaccount:default:router
oadm policy add-cluster-role-to-user cluster-reader system:serviceaccount:default:router
oc adm router router –replicas=1 –service-account=router部署 Image-Stream、Templete
cd ~
git clone https://github.com/openshift/openshift-ansibleoc create -f $IMAGESTREAMDIR/image-streams-centos7.json -n >openshift
oc create -f $DBTEMPLATES -n openshift
oc create -f $QSTEMPLATES -n openshift
容器运行时需要root权限
oc adm policy add-scc-to-group anyuid system:authenticated
oc adm policy add-scc-to-group anyuid system:admin
无法看到pod的日至,容器控制台无法连接
hostname 未绑定,修改 /etc/hosts
git 无法访问
检查容器是否能访问网络
看看是不是ping 的时候 加上了额外的dns-search 信息
修改 服务器上 /etc/resolv.conf文件 去掉 search 后面的内容
resolv.conf 的dns 增加一个 部署openshiftorigin 服务器的地址或者独立DNS地址Removing all searchdomain entries in /etc/sysconfig/network-scripts or /etc/resolv.conf file fixed the issue.
This was discovered by testing on a local setup with DHCP addressing instead of a manually assigned IP with the host in my original question, which worked fine, which helped to narrow down the issue to networking differences between both environments.
# Generated by NetworkManager
search
nameserver 192.168.199.1
nameserver 192.168.199.161