centos7搭建openshift-3.11

centos7搭建openshift-3.11

关闭防火墙和selinux

sed -i "s/SELINUX=enforcing/SELINUX=permissive/g" /etc/selinux/config 
systemctl stop firewalld 
systemctl disable firewalld

安装docker

yum install -y yum-utils 
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo 
yum -y install docker-ce

配置docker私有仓库地址

因为openshift安装成功后,会自行启动一个registry的私有仓库镜像以便使用,为了之后不用重新配置后还要重启docker,所以在此先行配置

集群自动启动的registry仓库地址就是172.30.x.x,所以如下配置

systemctl start docker
vim/etc/docker/daemon.json
{
  "insecure-registries": ["172.30.0.0/16"]
}
systemctl daemon-reload
systemctl restart docker
systemctl enable docker

安装包:
https://github.com/openshift/origin/releases/tag/v3.11.0
在这里插入图片描述
上传到安装目录,我当前是使用的root目录
解压缩并且重命名:

tar -zxvf openshift-origin-server-v3.11.0-0cbc58b-linux-64bit.tar.gz
mv openshift-origin-server-v3.11.0-0cbc58b-linux-64bit /opt/openshift-server-v3.11.0

修改/etc/profile,加入环境变量

PATH=$PATH:/opt/openshift-server-v3.11.0/ 
source /etc/profile

启动集群

oc cluster up --skip-registry-check=true --public-hostname="192.168.30.17" --no-proxy="192.168.30.17"

参数介绍:


skip-registry-check 代表是否跳过Docker守护进程注册表什么的检查
public-hostname 代表暴露在外部供访问的地址
no-proxy 代表哪些地址不需要转发(如果不加这个,有可能部署成功后访问地址会转发到 localhost 127.0.0.1)

启动成功的最后会有这个输出

plates/nodejs quickstart" "sample-templates/rails quickstart" "sample-templates/jenkins pipeline ephemeral" "sample-templates/sample pipeline" "sample-templates/mongodb" "sample-templates/mysql" "sample-templates/cakephp quickstart" "sample-templates/dancer quickstart"
I1217 09:17:15.503518   24655 interface.go:41] Finished installing "openshift-router" "centos-imagestreams" "openshift-image-registry" "openshift-web-console-operator" "sample-templates" "persistent-volumes"
Login to server ...
Creating initial project "myproject" ...
Server Information ...
OpenShift server started.

The server is accessible via web console at:
    https://192.168.30.17:8443

You are logged in as:
    User:     developer
    Password: <any value>

To login as administrator:
    oc login -u system:admin
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

clarence.wei

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值