Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
81-add-worker.yml 1.16 KB
Copy Edit Raw Blame History
setzero authored 2021-05-12 09:54 . [IMP]优化脚本默认值获取
# 校验节点软件系统及硬件系统、安装必要基础组件、docker、kubeadm、kubelet、kubectl
- hosts: all
gather_facts: false
tasks:
- name: "设置代理服务器环境变量"
set_fact:
proxy_env:
http_proxy: "{{ http_proxy | default ('') }}"
HTTP_PROXY: "{{ http_proxy | default ('') }}"
https_proxy: "{{ https_proxy | default ('') }}"
HTTPS_PROXY: "{{ https_proxy | default ('') }}"
no_proxy: "{{ no_proxy | default ('') }}"
NO_PROXY: "{{ no_proxy | default ('') }}"
no_log: true
- hosts:
- new-worker
roles:
- prepare/variables
- prepare/base
- prepare/container-engine
- prepare/kubernetes
environment: "{{ proxy_env }}"
# 进行apiserver负载均衡
- hosts:
- new-worker
roles:
- prepare/variables
- load-balancer
# 生成master节点证书
- hosts:
- kube-master
- new-master
- kube-worker
- new-worker
roles:
- prepare/variables
- kube-certificates
# 初始化worker节点
- hosts:
- new-worker
roles:
- prepare/variables
- kube-worker
# 标记各节点角色
- hosts:
- new-worker
roles:
- prepare/variables
- post
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化