forked from easzlab/kubeasz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
132 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,5 @@ | |
|
||
# [可选]多master部署时的负载均衡配置 | ||
- hosts: lb | ||
gather_facts: True | ||
roles: | ||
- lb |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- hosts: kube-cluster | ||
roles: | ||
- flannel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
- name: 创建flannel cni 相关目录 | ||
file: name={{ item }} state=directory | ||
with_items: | ||
- /etc/cni/net.d | ||
- /root/local/kube-system/flannel | ||
|
||
- name: 下载flannel cni plugins | ||
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755 | ||
with_items: | ||
- bridge | ||
- flannel | ||
- host-local | ||
- loopback | ||
- portmap | ||
|
||
- name: 准备 flannel DaemonSet yaml文件 | ||
template: src=kube-flannel.yaml.j2 dest=/root/local/kube-system/flannel/kube-flannel.yaml | ||
|
||
# 只需单节点执行一次,重复执行的报错可以忽略 | ||
- name: 运行 flannel网络 | ||
shell: "{{ bin_dir }}/kubectl create -f /root/local/kube-system/flannel/ && sleep 15" | ||
when: NODE_ID is defined and NODE_ID == "node1" | ||
ignore_errors: true | ||
|
||
# 删除原有cni配置 | ||
- name: 删除默认cni配置 | ||
file: path=/etc/cni/net.d/10-default.conf state=absent | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "calico-k8s-network", | ||
"cniVersion": "0.1.0", | ||
"type": "calico", | ||
"etcd_endpoints": "{{ ETCD_ENDPOINTS }}", | ||
"etcd_key_file": "/etc/calico/ssl/calico-key.pem", | ||
"etcd_cert_file": "/etc/calico/ssl/calico.pem", | ||
"etcd_ca_cert_file": "/etc/calico/ssl/ca.pem", | ||
"log_level": "info", | ||
"mtu": 1500, | ||
"ipam": { | ||
"type": "calico-ipam" | ||
}, | ||
"policy": { | ||
"type": "k8s" | ||
}, | ||
"kubernetes": { | ||
"kubeconfig": "/root/.kube/config" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "mynet", | ||
"type": "bridge", | ||
"bridge": "mynet0", | ||
"isDefaultGateway": true, | ||
"ipMasq": true, | ||
"hairpinMode": true, | ||
"ipam": { | ||
"type": "host-local", | ||
"subnet": "{{ CLUSTER_CIDR }}" | ||
} | ||
} |