1.节点添加

在新节点上编辑yum源/etc/yum.repo.d/ocp.repo

/etc/hosts在主和节点上都加上相应信息

编辑host文件,加入

[OSEv3:children]
masters
nodes
etcd
new_nodes [new_nodes]
node3.example.com openshift_node_group_name
='node-config-compute'

然后运行

cd /usr/share/ansible/openshift-ansible
ansible-playbook playbooks/openshift-node/scaleup.yml

机器资源不够,添加到最后审批阶段不通过,一看master 8443端口都不响应了,去掉infra节点后再来居然可以了。:-(

TASK [Approve node certificates when bootstrapping] *****************************************************************************************************
Monday December :: + (::00.416) ::43.233 *******
FAILED - RETRYING: Approve node certificates when bootstrapping ( retries left).
FAILED - RETRYING: Approve node certificates when bootstrapping ( retries left).
FAILED - RETRYING: Approve node certificates when bootstrapping ( retries left).
FAILED - RETRYING: Approve node certificates when bootstrapping ( retries left).
FAILED - RETRYING: Approve node certificates when bootstrapping ( retries left).
FAILED - RETRYING: Approve node certificates when bootstrapping ( retries left).
FAILED - RETRYING: Approve node certificates when bootstrapping ( retries left).
FAILED - RETRYING: Approve node certificates when bootstrapping ( retries left).
FAILED - RETRYING: Approve node certificates when bootstrapping ( retries left).
PLAY RECAP **********************************************************************************************************************************************
localhost : ok= changed= unreachable= failed=
master.example.com : ok= changed= unreachable= failed=
node3.example.com : ok= changed= unreachable= failed= INSTALLER STATUS ****************************************************************************************************************************************
Initialization : Complete (::)
Node Bootstrap Preparation : Complete (::)
Node Join : Complete (::)

Monday 03 December 2018 16:51:24 +0800 (0:00:00.471) 0:10:22.945 *******
===============================================================================
Approve node certificates when bootstrapping --------------------------------------------------------------------------------------------------- 185.53s
Run variable sanity checks ---------------------------------------------------------------------------------------------------------------------- 55.58s
Gathering Facts --------------------------------------------------------------------------------------------------------------------------------- 53.54s
container_runtime : Fixup SELinux permissions for docker ---------------------------------------------------------------------------------------- 22.34s
get openshift_current_version -------------------------------------------------------------------------------------------------------------------- 8.66s
Detecting Operating System from ostree_booted ---------------------------------------------------------------------------------------------------- 8.30s
Gather Cluster facts ----------------------------------------------------------------------------------------------------------------------------- 7.91s
openshift_sanitize_inventory : Check for usage of deprecated variables --------------------------------------------------------------------------- 7.17s
openshift_sanitize_inventory : set_stats --------------------------------------------------------------------------------------------------------- 4.83s
Ensure openshift-ansible installer package deps are installed ------------------------------------------------------------------------------------ 4.74s
openshift_node : Update journald setup ----------------------------------------------------------------------------------------------------------- 4.05s
openshift_sanitize_inventory : include_tasks ----------------------------------------------------------------------------------------------------- 3.85s
Initialize openshift.node.sdn_mtu ---------------------------------------------------------------------------------------------------------------- 3.66s
openshift_manage_node : Wait for sync DS to set annotations on all nodes ------------------------------------------------------------------------- 3.41s
tuned : Ensure files are populated from templates ------------------------------------------------------------------------------------------------ 3.12s
set_fact openshift_portal_net if present on masters ---------------------------------------------------------------------------------------------- 2.79s
Gathering Facts ---------------------------------------------------------------------------------------------------------------------------------- 2.76s
openshift_manage_node : Set node schedulability -------------------------------------------------------------------------------------------------- 2.54s
openshift_sanitize_inventory : include_tasks ----------------------------------------------------------------------------------------------------- 2.54s
tuned : Restart tuned service -------------------------------------------------------------------------------------------------------------------- 2.45s

[root@master openshift-ansible]# oc get nodes
NAME STATUS ROLES AGE VERSION
master.example.com Ready master 3d v1.11.0+d4cacc0
node1.example.com NotReady infra 3d v1.11.0+d4cacc0
node2.example.com Ready compute 3d v1.11.0+d4cacc0
node3.example.com Ready compute 16m v1.11.0+d4cacc0

2.删除节点

  • 目前已经调度的pod
[root@master openshift-ansible]# oc get pods --all-namespaces -o wide | grep node3
openshift-monitoring node-exporter-r2qrs / Running 17m 192.168.56.106 node3.example.com <none>
openshift-node sync-n4c7l / Running 17m 192.168.56.106 node3.example.com <none>
openshift-sdn ovs-jnqjc / Running 17m 192.168.56.106 node3.example.com <none>
openshift-sdn sdn-cc8zb / Running 17m 192.168.56.106 node3.example.com
<none>

也可以通过

[root@master openshift-ansible]# oc adm manage-node node3.example.com --list-pods

Listing matched pods on node: node3.example.com

NAMESPACE              NAME                  READY     STATUS    RESTARTS   AGE
openshift-monitoring node-exporter-r2qrs / Running 18m
openshift-node sync-n4c7l / Running 18m
openshift-sdn ovs-jnqjc / Running 18m
openshift-sdn sdn-cc8zb / Running 18m
  • 禁止调度
oc adm cordon node3.example.com
  • 驱逐pod
[root@master openshift-ansible]# oc adm drain node3.example.com --force=true
node/node3.example.com already cordoned
error: unable to drain node "node3.example.com", aborting command... There are pending nodes to be drained:
node3.example.com
error: DaemonSet-managed pods (use --ignore-daemonsets to ignore): node-exporter-r2qrs, sync-n4c7l, ovs-jnqjc, sdn-cc8zb
  • 删除节点
[root@master openshift-ansible]# oc delete nodes node3.example.com
node "node3.example.com" deleted

Openshift 节点添加和删除的更多相关文章

  1. MongoDB 副本集节点添加与删除

    replica set多服务器主从,添加,删除节点,肯定会经常遇到的.下面详细说明一下,添加,删除节点的2种方法. 一,利用rs.reconfig,来添加,删除节点 1,添加节点 查看复制打印 rep ...

  2. jQuery的节点添加、删除、替换等操作

    //几种添加节点的方法 //$("p").append("<b>你好吗?</b>");//向p元素中追加<b> //$(&q ...

  3. 为DOM节点添加或者删除class

    项目中如果应用了常用的javascript类库,多数情况下,这些已经封装好的类库,都会封装一个类似于addClass和removeClass的方法,以便于我们对DOM节点的class进行操作. 以jQ ...

  4. ztree-编辑节点(树节点添加,删除,修改)

    <!DOCTYPE html> <HTML> <HEAD> <TITLE> ZTREE DEMO - addNodes / editName / rem ...

  5. js给节点添加或删除类名

    为 <div> 元素添加 class: document.getElementById(“myDIV”).classList.add(“mystyle”); 为 <div> 元 ...

  6. 用JS添加和删除class类名

    下面介绍一下如何给一个节点添加和删除class名 添加:节点.classList.add("类名"): 删除:节点.classList.remove("类名") ...

  7. js 与 jq 的节点添加删除实例

    JavaScript实例:XML DOM节点的添加 <!DOCTYPE html> <html> <head> <meta charset="utf ...

  8. 添加和删除节点(HTML 元素)。

    JavaScript HTML DOM 元素(节点)   添加和删除节点(HTML 元素). 创建新的 HTML 元素 如需向 HTML DOM 添加新元素,您必须首先创建该元素(元素节点),然后向一 ...

  9. (转载)html dom节点操作(获取/修改/添加或删除)

    DOM 是关于如何获取.修改.添加或删除 HTML 元素的标准,下面为大家介绍下html dom节点操作,感兴趣的朋友可以参考下   HTML DOM 是关于如何获取.修改.添加或删除 HTML 元素 ...

随机推荐

  1. ueditor在QQ浏览器或者IE浏览器中无法加载

    因为IE浏览器有兼容问题,打开网址,浏览器不一定以最新的文档模式加载.按F12查看 在你网址的head标签中加入:<meta http-equiv="x-ua-compatible&q ...

  2. linux命令(25):ln命令

    命令格式: ln [参数][源文件或目录][目标文件或目录] 必要参数: -b 删除,覆盖以前建立的链接 -d 允许超级用户制作目录的硬链接 -f 强制执行 -i 交互模式,文件存在则提示用户是否覆盖 ...

  3. php文件上传错误信息

    错误信息说明 UPLOAD_ERR_OK:其值为0,没有错误发生,文件上传成功 UPLOAD_ERR_INI_SIZE:其值为1,上传的文件超过了php.ini和upload_max_filesize ...

  4. LeetCode解题报告—— Word Search & Subsets II & Decode Ways

    1. Word Search Given a 2D board and a word, find if the word exists in the grid. The word can be con ...

  5. 自己编译生成k8s的rpm包

    我指的是以下几个安装包: -rw-r--r--. 1 root root 8976134 Jul 13 10:19 kubeadm-1.7.0-0.x86_64.rpm-rw-r--r--. 1 ro ...

  6. android studio 入门比较好的书籍

    http://blog.csdn.NET/aqi00/article/details/50012511 http://blog.csdn.net/aqi00/article/details/73065 ...

  7. 【剑指offer】(第 2 版)Java 题解

    [剑指offer](第 2 版)Java 题解 第一章 面试的流程 略... 第二章 面试需要的基础知识 面试题 1. 赋值运算符函数 面试题 2. 实现 Singleton 模式 Solution ...

  8. LOJ #6285. 数列分块入门 9-分块(查询区间的最小众数)

    #6285. 数列分块入门 9 内存限制:256 MiB时间限制:1500 ms标准输入输出 题目类型:传统评测方式:文本比较 上传者: hzwer 提交提交记录统计测试数据讨论 2   题目描述 给 ...

  9. POJ 3660 Cow Contest (dfs)

    Cow Contest Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11129   Accepted: 6183 Desc ...

  10. shell中的特殊变量

    常见的特殊变量: $* 和 $@ 的区别: 1. 在这两个变量没有被双引号""引起来的时候,它们没有区别. 2. 在这两个变量被双引号""引起来的时候,&quo ...