JImmy的文档: 搭建集群版openshift origin-3.9

系统安装:

       系统配置,理论上一般配置都可以,推荐

                 内存 4G以上

                 CPU 4个以上

                 硬盘 100G以上。

       系统镜像: CentOS-7-x86_64-DVD-1804.iso 

       安装分组为: 带GUI的服务器


需要准备五台服务器,分别安装上面的系统和分组,并配置ip 和主机名,主机名如下: 

10.1.123.202 master1.neokylin.com.cn
10.1.123.203 master2.neokylin.com.cn
10.1.123.204 etcd1.neokylin.com.cn
10.1.123.205 node1.neokylin.com.cn

10.1.123.206 node2.neokylin.com.cn

在每台主机上配置/etc/hosts:

[root@master ~] cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.1.123.202 master1.neokylin.com.cn
10.1.123.203 master2.neokylin.com.cn
10.1.123.204 etcd1.neokylin.com.cn
10.1.123.205 node1.neokylin.com.cn
10.1.123.206 node2.neokylin.com.cn

分别添加各个主机对master主机的信任(master主机上运行):

[root@master ~]#  ssh-keygen
[root@master ~]#  ssh-copy-id -i ~/.ssh/id_rsa.pub master1.neokylin.com.cn
[root@master ~]#  ssh-copy-id -i ~/.ssh/id_rsa.pub master2.neokylin.com.cn
[root@master ~]#  ssh-copy-id -i ~/.ssh/id_rsa.pub etcd1.neokylin.com.cn
[root@master ~]#  ssh-copy-id -i ~/.ssh/id_rsa.pub node1.neokylin.com.cn
[root@master ~]#  ssh-copy-id -i ~/.ssh/id_rsa.pub node2.neokylin.com.cn

在每个主机上都安装yum源(在所有主机上运行):

[root@master ~] yum install centos-release-openshift-origin.noarch 

master节点上安装:

[root@ ]yum install openshift-ansible

在所有节点上运行:

 

[root@master ~]yum install docker

设置Docker的registry的访问网络范围(在所有主机上运行):

[root@master ~]sed -i '/OPTIONS=.*/c\OPTIONS="--log-driver=journald --insecure-registry 172.30.0.0/16"' /etc/sysconfig/docker   
[root@master ~]systemctl restart docker

在master节点进行批量安装部署:

  配置ansible文件:

[root@master ~]cat /etc/ansible/hosts
# Create an OSEv3 group that contains the master, nodes, etcd, and lb groups.
# The lb group lets Ansible configure HAProxy as the load balancing solution.
# Comment lb out if your load balancer is pre-configured.
[OSEv3:children]
masters
nodes
etcd

# Set variables common for all OSEv3 hosts
[OSEv3:vars]
ansible_ssh_user=root
openshift_deployment_type=origin

# Uncomment the following to enable htpasswd authentication; defaults to
# DenyAllPasswordIdentityProvider.
#openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}]

# Native high availbility cluster method with optional load balancer.
# If no lb group is defined installer assumes that a load balancer has
# been preconfigured. For installation the value of
# openshift_master_cluster_hostname must resolve to the load balancer
# or to one or all of the masters defined in the inventory if no load
# balancer is present.
openshift_enable_service_catalog=false
template_service_broker_install=false

openshift_public_ip=10.1.123.202

# apply updated node defaults
openshift_node_kubelet_args={'pods-per-core': ['10'], 'max-pods': ['250'], 'image-gc-high-threshold': ['90'], 'image-gc-low-threshold': ['80']}

# enable ntp on masters to 
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值