1 Star 0 Fork 18

JefferyChang/kubeasz

forked from 烂泥行天下/kubeasz 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
90.setup.yml 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
gjmzj 提交于 2019-06-23 07:36 . 替换playbook中hosts: all
# [optional] to synchronize time of nodes with 'chrony'
- hosts:
- kube-master
- kube-node
- etcd
- ex-lb
- chrony
roles:
- { role: chrony, when: "groups['chrony']|length > 0" }
# to create CA, kubeconfig, kube-proxy.kubeconfig etc.
- hosts: localhost
roles:
- deploy
# prepare tasks for all nodes
- hosts:
- kube-master
- kube-node
- etcd
roles:
- prepare
# to install etcd cluster
- hosts: etcd
roles:
- etcd
# to install container runtime
- hosts:
- kube-master
- kube-node
roles:
- { role: docker, when: "CONTAINER_RUNTIME == 'docker'" }
- { role: containerd, when: "CONTAINER_RUNTIME == 'containerd'" }
# to set up 'kube-master' nodes
- hosts: kube-master
roles:
- kube-master
- kube-node
tasks:
- name: Making master nodes SchedulingDisabled
shell: "{{ bin_dir }}/kubectl cordon {{ inventory_hostname }} "
when: "inventory_hostname not in groups['kube-node']"
ignore_errors: true
- name: Setting master role name
shell: "{{ bin_dir }}/kubectl label node {{ inventory_hostname }} kubernetes.io/role=master --overwrite"
ignore_errors: true
# to set up 'kube-node' nodes
- hosts: kube-node
roles:
- { role: kube-node, when: "inventory_hostname not in groups['kube-master']" }
# to install network plugin, only one can be choosen
- hosts:
- kube-master
- kube-node
roles:
- { role: calico, when: "CLUSTER_NETWORK == 'calico'" }
- { role: cilium, when: "CLUSTER_NETWORK == 'cilium'" }
- { role: flannel, when: "CLUSTER_NETWORK == 'flannel'" }
- { role: kube-router, when: "CLUSTER_NETWORK == 'kube-router'" }
- { role: kube-ovn, when: "CLUSTER_NETWORK == 'kube-ovn'" }
# to install cluster-addons
- hosts:
- kube-node
roles:
- cluster-addon
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cglcoder/kubeasz.git
git@gitee.com:cglcoder/kubeasz.git
cglcoder
kubeasz
kubeasz
master

搜索帮助