minor fixes

pull/1014/head
gjmzj 2021-04-24 20:23:06 +08:00
parent ddc15996a3
commit 1845483369
7 changed files with 13 additions and 9 deletions

5
ezctl
View File

@ -266,10 +266,13 @@ function cmd() {
;; ;;
esac esac
COMMAND="ansible-playbook -i clusters/$1/hosts -e @clusters/$1/config.yml playbooks/$PLAY_BOOK"
echo "$COMMAND"
logger info "cluster:$1 $2 begins in 5s, press any key to abort:\n" logger info "cluster:$1 $2 begins in 5s, press any key to abort:\n"
! (read -r -t5 -n1) || { logger warn "$2 abort"; return 1; } ! (read -r -t5 -n1) || { logger warn "$2 abort"; return 1; }
ansible-playbook -i "clusters/$1/hosts" -e "@clusters/$1/config.yml" "playbooks/$PLAY_BOOK" || return 1 ${COMMAND} || return 1
} }

5
ezdown
View File

@ -350,9 +350,10 @@ function start_kubeasz_docker() {
# run kubeasz docker container # run kubeasz docker container
docker run --detach \ docker run --detach \
--name kubeasz \
--restart always \
--env HOST_IP="$host_ip" \ --env HOST_IP="$host_ip" \
--name kubeasz \
--network host \
--restart always \
--volume "$BASE":"$BASE" \ --volume "$BASE":"$BASE" \
--volume /root/.kube:/root/.kube \ --volume /root/.kube:/root/.kube \
--volume /root/.ssh:/root/.ssh \ --volume /root/.ssh:/root/.ssh \

View File

@ -82,7 +82,7 @@
# 只需单节点执行一次 # 只需单节点执行一次
- name: 运行 calico网络 - name: 运行 calico网络
shell: "{{ bin_dir }}/kubectl apply -f {{ cluster_dir }}/yml/calico.yaml" shell: "{{ base_dir }}/bin/kubectl apply -f {{ cluster_dir }}/yml/calico.yaml"
run_once: true run_once: true
connection: local connection: local

View File

@ -65,7 +65,7 @@
# 只需单节点执行一次 # 只需单节点执行一次
- name: 运行 cilium网络 - name: 运行 cilium网络
shell: "{{ bin_dir }}/kubectl apply -f {{ cluster_dir }}/yml/cilium.yaml" shell: "{{ base_dir }}/bin/kubectl apply -f {{ cluster_dir }}/yml/cilium.yaml"
run_once: true run_once: true
connection: local connection: local

View File

@ -67,8 +67,8 @@
# connection: local # connection: local
# #
# - name: 创建 metallb controller 部署 # - name: 创建 metallb controller 部署
# shell: "{{ bin_dir }}/kubectl apply -f {{ cluster_dir }}/yml/metallb.yaml && \ # shell: "{{ base_dir }}/bin/kubectl apply -f {{ cluster_dir }}/yml/metallb.yaml && \
# {{ bin_dir }}/kubectl apply -f {{ cluster_dir }}/yml/{{ metallb_protocol }}.yaml" # {{ base_dir }}/bin/kubectl apply -f {{ cluster_dir }}/yml/{{ metallb_protocol }}.yaml"
# run_once: true # run_once: true
# connection: local # connection: local
# when: '"metallb" not in pod_info.stdout and metallb_install == "yes"' # when: '"metallb" not in pod_info.stdout and metallb_install == "yes"'

View File

@ -57,7 +57,7 @@
# 只需单节点执行一次 # 只需单节点执行一次
- name: 运行 flannel网络 - name: 运行 flannel网络
shell: "{{ bin_dir }}/kubectl apply -f {{ cluster_dir }}/yml/flannel.yaml" shell: "{{ base_dir }}/bin/kubectl apply -f {{ cluster_dir }}/yml/flannel.yaml"
run_once: true run_once: true
connection: local connection: local

View File

@ -59,7 +59,7 @@
# 只需单节点执行一次 # 只需单节点执行一次
- name: 运行 kube-router DaemonSet - name: 运行 kube-router DaemonSet
shell: "{{ bin_dir }}/kubectl apply -f {{ cluster_dir }}/yml/kube-router.yaml" shell: "{{ base_dir }}/bin/kubectl apply -f {{ cluster_dir }}/yml/kube-router.yaml"
run_once: true run_once: true
connection: local connection: local