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

1
ezdown
View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -55,27 +55,3 @@
- name: ansible 控制端创建 kubectl 软链接 - name: ansible 控制端创建 kubectl 软链接
file: src={{ base_dir }}/bin/kubectl dest=/usr/bin/kubectl state=link file: src={{ base_dir }}/bin/kubectl dest=/usr/bin/kubectl state=link
ignore_errors: true 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 - name: 下载flannel cni plugins
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755 copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755
with_items: with_items:

View File

@ -2,7 +2,6 @@
file: name={{ item }} state=directory file: name={{ item }} state=directory
with_items: with_items:
- /etc/cni/net.d - /etc/cni/net.d
- /opt/kube/images
- /opt/kube/kube-ovn - /opt/kube/kube-ovn
- name: 注册变量 ovn_default_gateway - 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 - name: 下载cni plugins
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755 copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755
with_items: with_items:

View File

@ -21,7 +21,7 @@
- "{{ bin_dir }}" - "{{ bin_dir }}"
- "{{ ca_dir }}" - "{{ ca_dir }}"
- /root/.kube - /root/.kube
- /opt/kube/images - /etc/cni/net.d
# 某些系统没有/usr/bin/python需要配置一个软链接否则connection: local的任务会失败 # 某些系统没有/usr/bin/python需要配置一个软链接否则connection: local的任务会失败
# 如果仍旧出现任务失败,重新执行一遍即可 https://github.com/ansible/ansible/issues/64903 # 如果仍旧出现任务失败,重新执行一遍即可 https://github.com/ansible/ansible/issues/64903
@ -35,24 +35,32 @@
lineinfile: lineinfile:
dest: ~/.bashrc dest: ~/.bashrc
state: present state: present
regexp: 'kubeasz' regexp: 'custom PATH'
line: 'export PATH={{ bin_dir }}:$PATH # generated by kubeasz' 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: - 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配置文件 - name: 分发 kubeconfig配置文件
copy: src={{ cluster_dir }}/kubectl.kubeconfig dest=/root/.kube/config mode=0400 copy: src={{ cluster_dir }}/kubectl.kubeconfig dest=/root/.kube/config mode=0400