OpenShift 4.2版本下如何加入RHEL 7.6的节点。

部署架构图

1.worker3所在的物理机

  • 建立一个helper-woker03.cfg文件用于节点虚机的建立和启动,注意nameserver字段应该指到helper也就是dns和负载均衡所在的机器。
[root@localhost data]# cat helper-worker03.cfg
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
cdrom
# Use graphical install
text
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=vda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF- # Network information
network --bootproto=static --device=eth0 --gateway=192.168.7.1 --ip=192.168.7.19 --netmask=255.255.255.0 --nameserver=192.168.7.11 --ipv6=auto --activate
network --hostname=worker-.ocp4.redhat.ren # Root password
rootpw --plaintext redhat
# System services
services --enabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc --ntpservers=.centos.pool.ntp.org,.centos.pool.ntp.org,.centos.pool.ntp.org,.centos.pool.ntp.org
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=vda
# Partition clearing information
clearpart --none --initlabel
# Disk partitioning information
part pv. --fstype="lvmpv" --ondisk=vda --size=
part /boot --fstype="xfs" --ondisk=vda --size=
volgroup vg0 --pesize= pv.
logvol / --fstype="xfs" --size= --name=root --vgname=vg0
logvol swap --fstype="swap" --size= --name=swap --vgname=vg0
reboot %packages
@^minimal
@core
chrony
kexec-tools %end %addon com_redhat_kdump --enable --reserve-mb='auto' %end %anaconda
pwpolicy root --minlen= --minquality= --notstrict --nochanges --notempty
pwpolicy user --minlen= --minquality= --notstrict --nochanges --emptyok
pwpolicy luks --minlen= --minquality= --notstrict --nochanges --notempty
%end
  • 然后建立虚机
virt-install --name="ocp4-worker3" --vcpus= --ram= \
--disk path=/data/kvm/ocp4-worker3.qcow2,bus=virtio,size= \
--os-variant centos7. --network bridge=br0,model=virtio \
--boot menu=on --location /data/rhel-server-7.6-x86_64-dvd.iso \
--initrd-inject helper-worker03.cfg --extra-args "inst.ks=file:/helper-worker03.cfg" --noautoconsole
virsh start ocp4-worker3

2.woker3节点

  • 登录新建的虚机,添加yum源
[base]
name=base
baseurl=http://192.168.7.1:8080/repo/rhel-7-server-rpms/
enabled=
gpgcheck=
[ansible]
name=ansible
baseurl=http://192.168.7.1:8080/repo/rhel-7-server-ansible-2.8-rpms/
enabled=
gpgcheck=
[extra]
name=extra
baseurl=http://192.168.7.1:8080/repo/rhel-7-server-extras-rpms/
enabled=
gpgcheck=
[ose]
name=ose
baseurl=http://192.168.7.1:8080/repo/rhel-7-server-ose-4.2-rpms/
enabled=
gpgcheck=
[tmp]
name=tmp
baseurl=http://192.168.7.1:8080/repo/tmp/
enabled=
gpgcheck=
  • 先安装openshift-clients-4.2.0和openshift-hyperkube-4.2.0版本(因为同步的repository只有4.2.1,会报错)

在同步repository的过程中会发现没有4.2.0这个版本,只有4.2.1版本,这时候通过命令将这两个包所需要的所有rpm拉到本地。(这一步坑得比较惨)

repotrack -p ./tmp/  openshift-hyperkube-4.2.0
repotrack -p ./tmp/  openshift-clients-4.2.0
yum install -y openshift-clients-4.2. openshift-hyperkube-4.2.

安装完成后为了避免和其他包的冲突把tmp的enabled修改为0。

  • 修改/etc/hosts,把镜像仓库地址加入,因为nameserver解析不了vm.redhat.com和registry.redhat.com,所以干脆直接写在/etc/hosts上。
[root@worker- ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.7.1 vm.redhat.ren
192.168.7.1 registry.redhat.ren

3.Helper节点

  • 修改named server能够解析woker-3.ocp4.redhat.ren
  • 修改zonefile.db
[root@helper named]# cat /var/named/zonefile.db
$TTL 1W
@ IN SOA ns1.ocp4.redhat.ren. root (
; serial
3H ; refresh ( hours)
30M ; retry ( minutes)
2W ; expiry ( weeks)
1W ) ; minimum ( week)
IN NS ns1.ocp4.redhat.ren.
IN MX smtp.ocp4.redhat.ren.
;
;
ns1 IN A 192.168.7.11
smtp IN A 192.168.7.11
;
helper IN A 192.168.7.11
helper IN A 192.168.7.11
;
; The api points to the IP of your load balancer
api IN A 192.168.7.11
api-int IN A 192.168.7.11
;
; The wildcard also points to the load balancer
*.apps IN A 192.168.7.11
;
; Create entry for the bootstrap host
bootstrap IN A 192.168.7.12
;
; Create entries for the master hosts
master- IN A 192.168.7.13
master- IN A 192.168.7.14
master- IN A 192.168.7.15
;
; Create entries for the worker hosts
worker- IN A 192.168.7.16
worker- IN A 192.168.7.17
worker- IN A 192.168.7.18
worker- IN A 192.168.7.19

;
; The ETCd cluster lives on the masters...so point these to the IP of the masters
etcd- IN A 192.168.7.13
etcd- IN A 192.168.7.14
etcd- IN A 192.168.7.15
;
; The SRV records are IMPORTANT....make sure you get these right...note the trailing dot at the end...
_etcd-server-ssl._tcp IN SRV etcd-.ocp4.redhat.ren.
_etcd-server-ssl._tcp IN SRV etcd-.ocp4.redhat.ren.
_etcd-server-ssl._tcp IN SRV etcd-.ocp4.redhat.ren.
;
;EOF
  • 修改反向解析文件reverse.db
[root@helper named]# cat /var/named/reverse.db
$TTL 1W
@ IN SOA ns1.ocp4.redhat.ren. root (
; serial
3H ; refresh ( hours)
30M ; retry ( minutes)
2W ; expiry ( weeks)
1W ) ; minimum ( week)
IN NS ns1.ocp4.redhat.ren.
;
; syntax is "last octet" and the host must have fqdn with trailing dot
IN PTR master-.ocp4.redhat.ren.
IN PTR master-.ocp4.redhat.ren.
IN PTR master-.ocp4.redhat.ren.
;
IN PTR bootstrap.ocp4.redhat.ren.
;
IN PTR api.ocp4.redhat.ren.
IN PTR api-int.ocp4.redhat.ren.
;
IN PTR worker-.ocp4.redhat.ren.
IN PTR worker-.ocp4.redhat.ren.
IN PTR worker-.ocp4.redhat.ren.
IN PTR worker-.ocp4.redhat.ren.
;
;EOF
  • 重启服务
systemctl start named
systemctl status named

通过/usr/local/bin/helpernodecheck或者ping来进行验证解析正确。

  • ssh-copy-id root@worker-3.ocp4.redhat.ren
  • 更新或者下载yum源
# subscription-manager repos \
--enable="rhel-7-server-rpms" \
--enable="rhel-7-server-extras-rpms" \
--enable="rhel-7-server-ansible-2.8-rpms" \
--enable="rhel-7-server-ose-4.2-rpms
  • 安装软件
yum install openshift-ansible openshift-clients jq
  • Ansible Inventory file和运行安装
[root@helper openshift-ansible]# cat /etc/ansible/hosts
[all:vars]
ansible_user=root
#ansible_become=True openshift_kubeconfig_path="/root/ocp4/auth/kubeconfig" [new_workers]
worker-.ocp4.redhat.ren
cd /usr/share/ansible/openshift-ansible
ansible-playbook -i /etc/ansible/hosts playbooks/scaleup.yml
TASK [openshift_node : Approve node CSR] ***********************************************************************************************************************************************
Thursday October :: + (::00.472) ::50.089 ******
FAILED - RETRYING: Approve node CSR ( retries left).
FAILED - RETRYING: Approve node CSR ( retries left).
FAILED - RETRYING: Approve node CSR ( retries left).
changed: [worker-.ocp4.redhat.ren -> localhost] => (item=worker-.ocp4.redhat.ren) TASK [openshift_node : Wait for nodes to report ready] *********************************************************************************************************************************
Thursday October :: + (::15.940) ::06.030 ******
FAILED - RETRYING: Wait for nodes to report ready ( retries left).
FAILED - RETRYING: Wait for nodes to report ready ( retries left).
FAILED - RETRYING: Wait for nodes to report ready ( retries left).
FAILED - RETRYING: Wait for nodes to report ready ( retries left).
FAILED - RETRYING: Wait for nodes to report ready ( retries left).
FAILED - RETRYING: Wait for nodes to report ready ( retries left).
FAILED - RETRYING: Wait for nodes to report ready ( retries left).
FAILED - RETRYING: Wait for nodes to report ready ( retries left).
FAILED - RETRYING: Wait for nodes to report ready ( retries left).
changed: [worker-.ocp4.redhat.ren -> localhost] => (item=worker-.ocp4.redhat.ren) PLAY RECAP *****************************************************************************************************************************************************************************
localhost : ok= changed= unreachable= failed= skipped= rescued= ignored=
worker-.ocp4.redhat.ren : ok= changed= unreachable= failed= skipped= rescued= ignored= Thursday October :: + (::46.976) ::53.007 ******
===============================================================================
openshift_node : Wait for nodes to report ready -------------------------------------------------------------------------------------------------------------------------------- .98s
openshift_node : Install openshift support packages ---------------------------------------------------------------------------------------------------------------------------- .90s
openshift_node : Install openshift packages ------------------------------------------------------------------------------------------------------------------------------------ .44s
openshift_node : Reboot the host and wait for it to come back ------------------------------------------------------------------------------------------------------------------ .51s
openshift_node : Approve node CSR ---------------------------------------------------------------------------------------------------------------------------------------------- .94s
openshift_node : Pull release image --------------------------------------------------------------------------------------------------------------------------------------------- .34s
openshift_node : Pull MCD image ------------------------------------------------------------------------------------------------------------------------------------------------- .19s
openshift_node : Apply ignition manifest ---------------------------------------------------------------------------------------------------------------------------------------- .65s
openshift_node : Get machine controller daemon image from release image --------------------------------------------------------------------------------------------------------- .08s
openshift_node : Get cluster nodes ---------------------------------------------------------------------------------------------------------------------------------------------- .87s
openshift_node : Setting sebool container_manage_cgroup ------------------------------------------------------------------------------------------------------------------------- .82s
openshift_node : Update CA trust ------------------------------------------------------------------------------------------------------------------------------------------------ .78s
openshift_node : Check for cluster no proxy ------------------------------------------------------------------------------------------------------------------------------------- .73s
openshift_node : Write /etc/containers/registries.conf -------------------------------------------------------------------------------------------------------------------------- .68s
openshift_node : Check for cluster http proxy ----------------------------------------------------------------------------------------------------------------------------------- .67s
openshift_node : Check for cluster https proxy ---------------------------------------------------------------------------------------------------------------------------------- .66s
openshift_node : Wait for bootstrap endpoint to show up ------------------------------------------------------------------------------------------------------------------------- .63s
openshift_node : Enable the CRI-O service --------------------------------------------------------------------------------------------------------------------------------------- .59s
openshift_node : Create CNI dirs for crio --------------------------------------------------------------------------------------------------------------------------------------- .54s
openshift_node : Approve node-bootstrapper CSR ---------------------------------------------------------------------------------------------------------------------------------- .47s
[root@helper openshift-ansible]#

查看csr

[root@helper auth]# oc get csr
NAME AGE REQUESTOR CONDITION
csr-4hhc9 3m47s system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Approved,Issued
csr-bn8ww 3m33s system:node:worker-.ocp4.redhat.ren Approved,Issued [root@helper auth]# oc get nodes
NAME STATUS ROLES AGE VERSION
master-.ocp4.redhat.ren Ready master 34h v1.14.6+c07e432da
master-.ocp4.redhat.ren Ready master 34h v1.14.6+c07e432da
master-.ocp4.redhat.ren Ready master 34h v1.14.6+c07e432da
worker-.ocp4.redhat.ren Ready worker 34h v1.14.6+c07e432da
worker-.ocp4.redhat.ren Ready worker 34h v1.14.6+c07e432da
worker-.ocp4.redhat.ren Ready worker 34h v1.14.6+c07e432da
worker-.ocp4.redhat.ren Ready worker 118s v1.14.6+c07e432da

安装过程中会把新加入的节点重启一次,启动完成后发送csr请求以及自动审批,然后加入集群中。

OpenShift 4.2 添加RHEL节点的更多相关文章

  1. Hadoop日常维护系列——Hadoop添加删除节点

    添加节点 1.修改host    和普通的datanode一样.添加namenode的ip 2.修改namenode的配置文件conf/slaves    添加新增节点的ip或host 3.在新节点的 ...

  2. 【实践】js 如何实现动态添加文本节点

    对于我这个js 小白来说 今天鼓起勇气做起了邮箱认证这个特效 但是这次不是想说如何实现这这个特效而是想记录一下特效当中的某个部分 那就是向元素节点动态添加文本节点 百度了一下动态添加文本节点的方式 是 ...

  3. 使用percona xtradb cluster的IST方式添加新节点

    使用percona xtradb cluster的IST(Incremental State Transfer)特性添加新节点,防止新节点加入时使用SST(State SnapShop Transfe ...

  4. Hadoop集群添加新节点步骤

    1.在新节点中进行操作系统配置,包括主机名.网络.防火墙和无密码登录等. 2.在所有节点/etc/host文件中添加新节点 3.把namenode的有关配置文件复制到该节点 4.修改master节点s ...

  5. java实现的可以无限级别添加子节点的菜单树

    网上大部分菜单树,都是单独用js代码来实现的,这样做的缺点是:用户无法动态的设置菜单项,比如,超级管理员可能需要根据每个用户的权限,赋予他们不同的系统功能,不同的功能对应着不同数量的菜单项. 对于此问 ...

  6. 高级复制实验配置添加复制节点操作时报错:ORA-23308: object GP.T does not exist or is invalid

    出错原因: 使用高级复制时,在源端启动复制支持,执行语句:REPADMIN@bys1>execute dbms_repcat.generate_replication_support('gp', ...

  7. 【Oracle】RAC添加新节点

    RAC添加节点: 环境: OS:OEL5.6 RAC:10.2.0.1.0 原有rac1,rac2两个节点.如今要添加rac3节点: 操作过程: 改动三个节点上的/etc/hosts文件 192.16 ...

  8. winform treeview 通过节点名称添加子节点

    /// <summary> /// 添加人员节点(利用TreeNodeCollection) /// </summary> /// <param name="t ...

  9. redis集群添加删除节点

    Redis3.0集群添加节点 1:首先把需要添加的节点启动 cd /usr/local/cluster/ mkdir 7006 cp /usr/local/cluster/redis.conf  /u ...

随机推荐

  1. 软件测试生命周期(STLC)的8个阶段的详细信息

    一.演化 ♦1960年代的趋势: ♦1990年代的趋势: ♦2000年代的趋势: 测试的趋势和能力正在发生变化.现在要求测试人员更加注重技术和流程.现在的测试不仅仅局限于发现错误,而且范围更广,从项目 ...

  2. 【VUE】图片预览放大缩小插件

    From: https://www.jianshu.com/p/e3350aa1b0d0 在看项目时,突然看到预览图片的弹窗,感觉好僵硬,不能放大,不能切换,于是便在网上找下关于图片预览的插件,有找到 ...

  3. 20180429模拟赛T1——添边问题

    [问题描述] 没有环的有向图称为有向无环图,这是一个多么美好的结构吖. 如果有一张有 N 个点的有向图,我们可能需要删掉一些边使它变成一张有向无环图.假设初始时我们只有 N 个互不相连的点,当然它也是 ...

  4. MapTask工作机制

    (1)Read阶段:MapTask通过用户编写的RecordReader,从输入InputSplit中解析出一个个key/value. (2)Map阶段:该节点主要是将解析出的key/value交给用 ...

  5. 20-2 树莓派搭建服务器 Tornado Web服务器

    Drive.google.com/drive/folders/1ahbeoEHkjxoo4NV1wReOmpoRWbl448z- 1.Tornado简介 Tornado一款使用 Python 编写的, ...

  6. (知识点1)#pragma once 与 #ifndef 解析

    例如 为了避免同一个文件被include多次,C/C++中有两种方式,一种是#ifndef方式,一种是#pragma once方式.在能够支持这两种方式的编译器上,二者并没有太大的区别,但是两者仍然还 ...

  7. Windows 10中的CSC.exe、CSC.rsp

    (1)CSC.exe位置 [4.0的位于] C:\Windows\Microsoft.NET\Framework\v4.0.30319 [之后版本的位于] C:\Program Files (x86) ...

  8. PHP引用(&)

    引用是什么 在 PHP 中引用意味着用不同的名字访问同一个变量内容.这并不像 C 的指针:例如你不能对他们做指针运算,他们并不是实际的内存地址.替代的是,引用是符号表别名.注意在PHP 中,变量名和变 ...

  9. ubuntu 安装任何版本的Firefox

    https://ftp.mozilla.org/pub/firefox/releases/ 1.sudo gedit /usr/share/applications/firefox.desktop 2 ...

  10. JavaScript 中 call()、apply()、bind() 的用法

    "use strict"; ; var obj = { name:'小李', age:, getInfo(from, to) { console.log(arguments) co ...