单master + 双node

1.主机角色划分

#采用双网段部署  0 网段是opesnshift内部通信IP,1 网段是连接外网通信地址
#master
master.example.com
192.168.0.39
192.168.1.39 #node1
node1.example.com
192.168.0.40
192.168.1.40 #node2
node2.example.com
192.168.0.41
192.168.1.41

2.系统初始化 

2.1  开启SELinux

[root@master ~]# cat /etc/sysconfig/selinux 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

2.2  安装基础组件

yum install wget git net-tools bind-utils yum-utils iptables-services bridge-utils bash-completion kexec-tools sos psacct -y

2.3  更新操作系统

yum  update -y
reboot

2.4  配置ansible

## install ansible
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sed -i -e "s/^enabled=1/enabled=0/" /etc/yum.repos.d/epel.repo
yum -y --enablerepo=epel install ansible pyOpenSSL

#checkout install playbooks
 cd ~
 git clone https://github.com/openshift/openshift-ansible
 cd openshift-ansible
 git checkout release-3.10

2.5 设置SSH免密登录(master -> node)

## ssh
ssh-keygen
for host in master.example.com \
master.example.com \
node1.example.com \
node2.example.com; \
do ssh-copy-id -i ~/.ssh/id_rsa.pub $host; \
done

3.开始部署

3.1 更新hosts配置文件

[root@master ~]# cat /etc/ansible/hosts
[OSEv3:children]
masters
nodes
etcd
nfs [OSEv3:vars]
ansible_ssh_user=root
openshift_deployment_type=origin
#因采用虚拟机部署学习 配置此选项跳过主机硬件信息检查
openshift_disable_check=disk_availability,docker_storage,memory_availability,docker_image_availability
openshift_master_identity_providers=[{'name':'htpasswd_auth','login':'true','challenge':'true','kind':'HTPasswdPasswordIdentityProvider',}] openshift_master_default_subdomain=apps.test.example.com
openshift_deployment_type=origin
os_firewall_use_firewalld=true [masters]
master.example.com [etcd]
master.example.com [nodes]
master.example.com openshift_node_group_name='node-config-master'
node1.example.com openshift_node_group_name='node-config-compute'
node2.example.com openshift_node_group_name='node-config-compute' [nfs]
master.example.com

3.2 执行预安装检测

[root@master ~]# ansible-playbook openshift-ansible/playbooks/prerequisites.yml

3.3 正式安装

[root@master ~]# ansible-playbook openshift-ansible/playbooks/deploy_cluster.yml

4.FAQ 

Q1 Docker HUB下载镜像缓慢导致执行deploy脚本失败##更改docker 的配置文件 /etc/sysconfig/docker

设置国内docker 镜像仓库例如阿里云加速

OPTIONS=' --selinux-enabled=false       --signature-verification=False --registry-mirror=https://c9ojlmr5.mirror.aliyuncs.com'

#需要重启docker
systemctl restart docker #手动pull master和node使用的images #master镜像列表  docker.io/cockpit/kubernetes
 docker.io/openshift/origin-haproxy-router
docker.io/openshift/origin-haproxy-router  
docker.io/openshift/origin-service-catalog

  docker.io/openshift/origin-node
  docker.io/openshift/origin-deployer
  docker.io/openshift/origin-control-plane
  docker.io/openshift/origin-control-plane
  docker.io/openshift/origin-template-service-broker
  docker.io/openshift/origin-pod
  docker.io/cockpit/kubernetes
  docker.io/openshift/origin-web-console
  quay.io/coreos/etcd

  #node镜像列表

  docker.io/openshift/origin-haproxy-router
  docker.io/openshift/origin-node
  docker.io/openshift/origin-deployer
  docker.io/openshift/origin-pod
  docker.io/ansibleplaybookbundle/origin-ansible-service-broker
  docker.io/openshift/origin-docker-registry
  docker-registry.default.svc:5000/openshift/jenkins


Q2 执行deploy时主机dns导致连外网失败

临时解决方案更改/etc/resolv.conf
echo nameserver 114.114.114.114 >>/etc/resolv.conf

OpenShift-OKD3.10基础环境部署的更多相关文章

  1. openstack(pike 版)集群部署(一)----基础环境部署

    一.环境 1.系统: a.CentOS Linux release 7.4.1708 (Core) b.更新yum源和安装常用软件 #  yum -y install  epel-release ba ...

  2. OpenStack实践系列①openstack简介及基础环境部署

    OpenStack实践系列①openstack简介及基础环境部署 一.OpenStack初探1.1 OpenStack简介 OpenStack是一整套开源软件项目的综合,它允许企业或服务提供者建立.运 ...

  3. mongodb基础环境部署(windows系统下)

    Normal 0 false 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE /* Style Definitions */ table.MsoNorma ...

  4. Jenkins+maven+gitlab自动化部署之基础环境部署(一)

    从一个二线城市,来到上海,刚入职,老大就给任务,为了减少开发打包部署时间,需要搭建一套自动化部署环境.接到任务后,赶紧上网查找资料,以及了解jenkins作用等等,用了一周时间,了解了个大概,由于都是 ...

  5. InfluxDB+Grafana大数据监控系列之基础环境部署(一)

    一.单节点环境部署 机器节点信息及 InfluxDB.Grafana 版本选择: 节点 Linux版本 部署服务 10.223.1.198 Centos 6.8 InfluxDB 1.7.7 10.2 ...

  6. 虚拟机console基础环境部署——工作目录准备

    1. 概述2. 相关约定2.1 删除旧文件2.2 创建全局共享文件目录2.3 创建全局软件安装目录2.4 创建数据放置目录3. 总结 1. 概述 上述博客中,已经为console最小化安装了操作系统. ...

  7. 虚拟机console基础环境部署——系统基础环境

    1. 概述2. 工具类安装2.1 安装vim2.2 安装tree2.3 安装expect2.4 安装lsof3. 编译环境类安装 1. 概述 本系列博客是在最小化安装CentOS6.5的基础上,通过配 ...

  8. 服务器环境迁移,Linux centos7 64位 基础环境部署 jdk+tomcat+mysql+nginx

    最近阿里云服务器到期,这个周末连夜将服务器迁移到美国去了,为什么迁移到美国去呢?主要是因为阿里云服务器费用高,另外网站的访问量不大,对网速要求也不高,主要是宣传和信息传递的作用,加上本人之前在***上 ...

  9. 虚拟机console基础环境部署——配置本地YUM源

    1. CD/ROM装载系统镜像2. 挂载设备3. 配置本地源4. 总结 有关YUM源及Linux系统三大软件管理方式,参照博客<CentOS系统三大软件管理>,笔记内链:CentOS系统三 ...

随机推荐

  1. canvas :原生javascript编写动态时钟

    canvas :原生javascript编写动态时钟     此时针是以画布的中心为圆心: g.translate(width/2,width/2); 此函数是将画布的原点移到(width/2,wid ...

  2. eclipse java web项目经常自动调试进入debug模式

    今天在运行Javaweb项目时,程序运行运行着就自动调试进入ThreadpoolExecutor,看着非常影响心情.最后在网上搜解决方法最后找到原因,解决方法如下. Window——>Prefe ...

  3. H5音乐播放器源码共享

    由于博客云后台管理工具写起东西来实在难受,所以直接共享源码了! https://pan.baidu.com/s/1XeRxlk7iv5qt1f16s64F9w   H5源码!暂时只支持手机适配,电脑端 ...

  4. SpringBoot中redis的使用介绍

    REmote DIctionary Server(Redis) 是一个由Salvatore Sanfilippo写的key-value存储系统. Redis是一个开源的使用ANSI C语言编写.遵守B ...

  5. ubuntu下配置时间同步NTP

    1参考文献: 1.鸟哥的Linux私房菜:第十五章.时间服务器: NTP 服务器(强烈建议看完) 2.http://www.crsay.com/wiki/wiki.php/server/centos/ ...

  6. innodb_file_per_table - 转换为InnoDB

    共享InnoDB / var / lib / mysql / ibdata1存储的问题InnoDB表当前将数据和索引存储到共享表空间(/ var / lib / mysql / ibdata1).由于 ...

  7. guider – 全系统Linux性能分析器

    Guider是一个免费且开源的,功能强大的全系统性能分析工具,主要以Python for Linux 操作系统编写. 它旨在衡量系统资源使用量并跟踪系统行为,从而使其可以有效分析系统性能问题或进行性能 ...

  8. Remove Rar Password OnLine

    How to Remove Rar passwords without any software : One of the most frustrating thing in our digital ...

  9. inotify+rsync的组合使用简单介绍

    inotify简介: inotify是一种强大的.细粒度的.异步的文件系统事件监控机制,linux内核从2.6.13起,加入了inotify支持,通过inotify可以监控文件系统添加.删除.修改.移 ...

  10. 如何在linux centos 环境下运行.exe文件

    linux是不能运行window下的可执行文件的,必须借助于wine.百度了以下wine如下:   Wine (“Wine Is Not an Emulator” 的递归缩写)是一个能够在多种 POS ...