From 54652adfa22768e1b9b3cfc448f3f08303975402 Mon Sep 17 00:00:00 2001 From: gjmzj Date: Mon, 28 May 2018 23:25:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4gather=5Ffa?= =?UTF-8?q?cts:=20smart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ansible.cfg | 2 +- docs/06-安装calico网络组件.md | 2 +- roles/lb/tasks/main.yml | 4 ---- roles/os-harden/tasks/main.yml | 3 --- roles/prepare/tasks/main.yml | 4 ---- 5 files changed, 2 insertions(+), 13 deletions(-) diff --git a/ansible.cfg b/ansible.cfg index 86261b1..d3b9fbd 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -29,7 +29,7 @@ # smart - gather by default, but don't regather if already gathered # implicit - gather by default, turn off with gather_facts: False # explicit - do not gather by default, must say gather_facts: True -gathering = explicit +gathering = smart # additional paths to search for roles in, colon separated roles_path = /etc/ansible/roles diff --git a/docs/06-安装calico网络组件.md b/docs/06-安装calico网络组件.md index c46bcf7..6bd0a01 100644 --- a/docs/06-安装calico网络组件.md +++ b/docs/06-安装calico网络组件.md @@ -84,7 +84,7 @@ roles/calico/ ### 安装calico 网络 + 安装前检查主机名不能有大写字母,只能由`小写字母` `-` `.` 组成 (name must consist of lower case alphanumeric characters, '-' or '.' (regex: [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*))(calico-node v3.0.6以上已经解决主机大写字母问题) -+ **安全前必须确保各节点主机名不重复** ,calico node name 由节点主机名决定,如果重复,那么重复节点在etcd中只存储一份,那么肯定出问题,BGP 邻居也不会建立 ++ **安装前必须确保各节点主机名不重复** ,calico node name 由节点主机名决定,如果重复,那么重复节点在etcd中只存储一份配置,BGP 邻居也不会建立。 + 安装之前必须确保`kube-master`和`kube-node`节点已经成功部署 + 只需要在任意装有kubectl客户端的节点运行 `kubectl create `安装即可 + 等待15s后(视网络拉取calico相关镜像速度),calico 网络插件安装完成,删除之前kube-node安装时默认cni网络配置 diff --git a/roles/lb/tasks/main.yml b/roles/lb/tasks/main.yml index c85f167..94162c6 100644 --- a/roles/lb/tasks/main.yml +++ b/roles/lb/tasks/main.yml @@ -1,7 +1,3 @@ -# 先拉取下节点的ansible setup信息,起到缓存效果,否则后续when 判断可能失败 -- name: 缓存ansilbe setup信息 - setup: gather_subset=min - - name: apt更新缓存刷新 apt: update_cache=yes cache_valid_time=72000 when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16" diff --git a/roles/os-harden/tasks/main.yml b/roles/os-harden/tasks/main.yml index c005db0..685cfff 100644 --- a/roles/os-harden/tasks/main.yml +++ b/roles/os-harden/tasks/main.yml @@ -1,7 +1,4 @@ --- -- name: 缓存ansilbe setup信息 - setup: gather_subset=all - - name: apt更新缓存刷新 apt: update_cache=yes cache_valid_time=72000 when: ansible_os_family == 'Debian' diff --git a/roles/prepare/tasks/main.yml b/roles/prepare/tasks/main.yml index a428b9d..eec381f 100644 --- a/roles/prepare/tasks/main.yml +++ b/roles/prepare/tasks/main.yml @@ -33,10 +33,6 @@ - ca.csr - ca-config.json -# 先拉取下节点的ansible setup信息,起到缓存效果,否则后续when 判断可能失败 -- name: 缓存ansilbe setup信息 - setup: gather_subset=min - # 删除默认安装 - name: 删除ubuntu默认安装 when: ansible_distribution == "Ubuntu"