fix:nf_conntrack模块安装判断等

pull/1086/head
gjmzj 2021-10-15 12:50:34 +08:00
parent 8d24ad9b03
commit 7b4fd5686f
7 changed files with 20 additions and 17 deletions

View File

@ -91,7 +91,7 @@ ssh-copy-id $IPs #$IPs为所有节点地址包括自身按照提示输入yes
``` bash
# 下载工具脚本ezdown举例使用kubeasz版本3.0.0
export release=3.0.0
curl -C- -fLO --retry 3 https://github.com/easzlab/kubeasz/releases/download/${release}/ezdown
wget https://github.com/easzlab/kubeasz/releases/download/${release}/ezdown
chmod +x ./ezdown
# 使用工具脚本下载
./ezdown -D

View File

@ -10,7 +10,7 @@ kubeasz 2.0.1 开始支持**完全离线安装**,目前已测试 `Ubuntu1604|1
``` bash
export release=3.0.0
curl -C- -fLO --retry 3 https://github.com/easzlab/kubeasz/releases/download/${release}/ezdown
wget https://github.com/easzlab/kubeasz/releases/download/${release}/ezdown
chmod +x ./ezdown
```

View File

@ -16,7 +16,7 @@
``` bash
export release=3.0.0
curl -C- -fLO --retry 3 https://github.com/easzlab/kubeasz/releases/download/${release}/ezdown
wget https://github.com/easzlab/kubeasz/releases/download/${release}/ezdown
chmod +x ./ezdown
```

2
ezctl
View File

@ -132,7 +132,7 @@ EOF
function new() {
# check if already existed
[[ -d "clusters/$1" ]] && { logger error "cluster:$1 already existed, if cluster:$1 setup failed, try 'rm -rf clusters/$1' first!"; exit 1; }
[[ -d "clusters/$1" ]] && { logger error "cluster:$1 already existed, if cluster:$1 setup failed, try 'rm -rf $BASE/clusters/$1' first!"; exit 1; }
logger debug "generate custom cluster files in $BASE/clusters/$1"
mkdir -p "clusters/$1"

8
ezdown
View File

@ -86,10 +86,10 @@ function download_docker() {
logger warn "docker binaries already existed"
else
logger info "downloading docker binaries, version $DOCKER_VER"
if [[ -e /usr/bin/curl ]];then
curl -C- -O --retry 3 "$DOCKER_URL" || { logger error "downloading docker failed"; exit 1; }
if [[ -e /usr/bin/wget ]];then
wget -c --no-check-certificate "$DOCKER_URL" || { logger error "downloading docker failed"; exit 1; }
else
wget -c "$DOCKER_URL" || { logger error "downloading docker failed"; exit 1; }
curl -k -C- -O --retry 3 "$DOCKER_URL" || { logger error "downloading docker failed"; exit 1; }
fi
/bin/mv -f "./docker-$DOCKER_VER.tgz" "$BASE/down"
fi
@ -345,7 +345,7 @@ function start_kubeasz_docker() {
fi
# create a link '/usr/bin/python' in Ubuntu1604
if [[ ! -e /usr/bin/python && -e /etc/debian_version ]]; then
if [[ ! -e /usr/bin/python && -e /usr/bin/python3 ]]; then
logger debug "create a soft link '/usr/bin/python'"
ln -s /usr/bin/python3 /usr/bin/python
fi

View File

@ -12,16 +12,17 @@
- name: 转换内核版本为浮点数
set_fact:
KERNEL_VER: "{{ ansible_kernel.split('-')[0].split('.')[0]|int + ansible_kernel.split('-')[0].split('.')[1]|int/100 }}"
KERNEL_VER: "{{ ansible_kernel.split('-')[0].split('.')[0]|int + ansible_kernel.split('-')[0].split('.')[1]|int/100 }}"
- name: 设置 nf_conntrack 模块名
set_fact: NF_CONNTRACK="nf_conntrack"
when: "KERNEL_VER|float >= 4.19"
#- name: 设置 nf_conntrack 模块名
# set_fact: NF_CONNTRACK="nf_conntrack"
# when: "KERNEL_VER|float >= 4.19"
- name: 设置 nf_conntrack_ipv4 模块名
set_fact: NF_CONNTRACK="nf_conntrack_ipv4"
when: "KERNEL_VER|float < 4.19"
#- name: 设置 nf_conntrack_ipv4 模块名
# set_fact: NF_CONNTRACK="nf_conntrack_ipv4"
# when: "KERNEL_VER|float < 4.19"
# 若提示nf_conntrack_ipv4模块不存在错误可以忽略
- name: 加载内核模块
modprobe: name={{ item }} state=present
with_items:
@ -30,7 +31,8 @@
- ip_vs_rr
- ip_vs_wrr
- ip_vs_sh
- "{{ NF_CONNTRACK }}"
- nf_conntrack
- nf_conntrack_ipv4
ignore_errors: true
- name: 启用systemd自动加载模块服务

View File

@ -3,4 +3,5 @@ ip_vs
ip_vs_rr
ip_vs_wrr
ip_vs_sh
{{ NF_CONNTRACK }}
nf_conntrack
nf_conntrack_ipv4