minor fixes

pull/1166/head
jin.gjm 2022-06-13 19:03:45 +08:00
parent abfadf011f
commit 42952eb72e
11 changed files with 28 additions and 76 deletions

View File

@ -114,9 +114,6 @@ DIRECT_ROUTING: false
flannelVer: "__flannel__"
flanneld_image: "easzlab.io.local:5000/easzlab/flannel:{{ flannelVer }}"
# [flannel]离线镜像tar包
flannel_offline: "flannel_{{ flannelVer }}.tar"
# ------------------------------------------- calico
# [calico]设置 CALICO_IPV4POOL_IPIP=“off”,可以提高网络性能,条件限制详见 docs/setup/calico.md
CALICO_IPV4POOL_IPIP: "Always"
@ -133,9 +130,6 @@ calico_ver: "__calico__"
# [calico]calico 主版本
calico_ver_main: "{{ calico_ver.split('.')[0] }}.{{ calico_ver.split('.')[1] }}"
# [calico]离线镜像tar包
calico_offline: "calico_{{ calico_ver }}.tar"
# ------------------------------------------- cilium
# [cilium]CILIUM_ETCD_OPERATOR 创建的 etcd 集群节点数 1,3,5,7...
ETCD_CLUSTER_SIZE: 1
@ -143,16 +137,12 @@ ETCD_CLUSTER_SIZE: 1
# [cilium]镜像版本
cilium_ver: "__cilium__"
# [cilium]离线镜像tar包
cilium_offline: "cilium_{{ cilium_ver }}.tar"
# ------------------------------------------- kube-ovn
# [kube-ovn]选择 OVN DB and OVN Control Plane 节点默认为第一个master节点
OVN_DB_NODE: "{{ groups['kube_master'][0] }}"
# [kube-ovn]离线镜像tar包
kube_ovn_ver: "__kube_ovn__"
kube_ovn_offline: "kube_ovn_{{ kube_ovn_ver }}.tar"
# ------------------------------------------- kube-router
# [kube-router]公有云上存在限制,一般需要始终开启 ipinip自有环境可以设置为 "subnet"
@ -165,10 +155,6 @@ FIREWALL_ENABLE: "true"
kube_router_ver: "__kube_router__"
busybox_ver: "1.28.4"
# [kube-router]kube-router 离线镜像tar包
kuberouter_offline: "kube-router_{{ kube_router_ver }}.tar"
busybox_offline: "busybox_{{ busybox_ver }}.tar"
############################
# role:cluster-addon

1
ezdown
View File

@ -467,7 +467,6 @@ function start_kubeasz_docker() {
--restart always \
--volume "$BASE":"$BASE" \
--volume /root/.kube:/root/.kube \
--volume /root/.bashrc:/root/.bashrc \
--volume /root/.ssh:/root/.ssh \
--volume /etc/docker:/etc/docker \
easzlab/kubeasz:${KUBEASZ_VER} sleep 36000

View File

@ -1,9 +1,7 @@
- name: 在节点创建相关目录
file: name={{ item }} state=directory
with_items:
- /etc/cni/net.d
- /etc/calico/ssl
- /opt/kube/images
- name: 创建calico 证书请求
template: src=calico-csr.json.j2 dest={{ cluster_dir }}/ssl/calico-csr.json

View File

@ -11,7 +11,6 @@
with_items:
- /etc/cni/net.d
- /var/run/cilium
- /opt/kube/images
- name: Optional-Mount BPF FS
mount:

View File

@ -27,11 +27,10 @@
- 'HELM_TLS_ENABLE'
when: 'DEL_ENV == "yes"'
#- name: remove binaries and offline images
#- name: remove binaries
# file: name={{ item }} state=absent
# with_items:
# - "/opt/kube/bin"
# - "/opt/kube/images"
# when: 'DEL_ETCD == "yes" and DEL_NODE == "yes" and DEL_MASTER == "yes"'
- name: 重启提示 WARNNING

View File

@ -56,5 +56,5 @@
dest: ~/.bashrc
state: present
regexp: 'crictl completion'
line: 'source <(crictl completion)'
line: 'source <(crictl completion) # generated by kubeasz'
when: "'NoFound' in containerd_svc.stdout"

View File

@ -55,27 +55,3 @@
- name: ansible 控制端创建 kubectl 软链接
file: src={{ base_dir }}/bin/kubectl dest=/usr/bin/kubectl state=link
ignore_errors: true
- name: ansible 控制端写入环境变量$PATH
lineinfile:
dest: ~/.bashrc
state: present
regexp: 'custom PATH'
line: 'export PATH={{ base_dir }}/bin/:$PATH # custom PATH generated by kubeasz'
ignore_errors: true
- name: ansible 控制端写入命令别名
lineinfile:
dest: ~/.bashrc
state: present
regexp: 'docker exec'
line: "alias dek='docker exec -it kubeasz' # custom PATH generated by kubeasz"
ignore_errors: true
- name: ansible 控制端添加 kubectl 自动补全
lineinfile:
dest: ~/.bashrc
state: present
regexp: 'kubectl completion'
line: 'source <(kubectl completion bash) # generated by kubeasz'
ignore_errors: true

View File

@ -1,9 +1,3 @@
- name: 创建flannel 相关目录
file: name={{ item }} state=directory
with_items:
- /etc/cni/net.d
- /opt/kube/images
- name: 下载flannel cni plugins
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755
with_items:

View File

@ -2,7 +2,6 @@
file: name={{ item }} state=directory
with_items:
- /etc/cni/net.d
- /opt/kube/images
- /opt/kube/kube-ovn
- name: 注册变量 ovn_default_gateway

View File

@ -1,9 +1,3 @@
- name: 创建cni 和kube-router 相关目录
file: name={{ item }} state=directory
with_items:
- /etc/cni/net.d
- /opt/kube/images
- name: 下载cni plugins
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755
with_items:

View File

@ -21,7 +21,7 @@
- "{{ bin_dir }}"
- "{{ ca_dir }}"
- /root/.kube
- /opt/kube/images
- /etc/cni/net.d
# 某些系统没有/usr/bin/python需要配置一个软链接否则connection: local的任务会失败
# 如果仍旧出现任务失败,重新执行一遍即可 https://github.com/ansible/ansible/issues/64903
@ -31,28 +31,36 @@
ln --symbolic /usr/bin/python3 /usr/bin/python;
fi
- name: 写入环境变量$PATH
- name: 写入环境变量$PATH
lineinfile:
dest: ~/.bashrc
state: present
regexp: 'kubeasz'
line: 'export PATH={{ bin_dir }}:$PATH # generated by kubeasz'
regexp: 'custom PATH'
line: 'export PATH={{ base_dir }}/bin/:$PATH # generated by kubeasz:custom PATH'
- name: ansible 控制端写入命令别名
lineinfile:
dest: ~/.bashrc
state: present
regexp: 'docker exec'
line: "alias dk='docker exec -it kubeasz' # generated by kubeasz"
when: "inventory_hostname == ansible_env.SSH_CLIENT.split(' ')[0]"
- name: 添加 kubectl 自动补全
lineinfile:
dest: ~/.bashrc
state: present
regexp: 'kubectl completion'
line: 'source <(kubectl completion bash) # generated by kubeasz'
- name: 添加 local registry hosts 解析
lineinfile:
dest: /etc/hosts
state: present
regexp: 'easzlab.io.local'
line: "{{ ansible_env.SSH_CLIENT.split(' ')[0] }} easzlab.io.local"
- block:
- name: 添加 local registry hosts 解析
lineinfile:
dest: /etc/hosts
state: present
regexp: 'easzlab.io.local'
line: "{{ ansible_env.SSH_CLIENT.split(' ')[0] }} easzlab.io.local"
- name: 添加 kubectl 命令自动补全
lineinfile:
dest: ~/.bashrc
state: present
regexp: 'kubectl completion'
line: 'source <(kubectl completion bash)'
- name: 分发 kubeconfig配置文件
copy: src={{ cluster_dir }}/kubectl.kubeconfig dest=/root/.kube/config mode=0400