minor fixes

pull/1006/head
gjmzj 2021-04-15 23:19:40 +08:00
parent a250741823
commit d2a83d06a0
7 changed files with 37 additions and 27 deletions

View File

@ -4,7 +4,6 @@
- /etc/cni/net.d
- /etc/calico/ssl
- /opt/kube/images
- /opt/kube/kube-system
- name: 创建calico 证书请求
template: src=calico-csr.json.j2 dest={{ cluster_dir }}/ssl/calico-csr.json
@ -39,9 +38,6 @@
when: '"calico-etcd-secrets" not in secrets_info.stdout'
run_once: true
- name: 配置 calico DaemonSet yaml文件
template: src=calico-{{ calico_ver_main }}.yaml.j2 dest=/opt/kube/kube-system/calico.yaml
# 【可选】推送离线docker 镜像,可以忽略执行错误
- block:
- name: 检查是否已下载离线calico镜像
@ -79,10 +75,16 @@
ignore_errors: true
when: "item in image_info.stdout and CONTAINER_RUNTIME == 'containerd'"
- name: 配置 calico DaemonSet yaml文件
template: src=calico-{{ calico_ver_main }}.yaml.j2 dest={{ cluster_dir }}/yml/calico.yaml
run_once: true
connection: local
# 只需单节点执行一次
- name: 运行 calico网络
shell: "{{ bin_dir }}/kubectl apply -f /opt/kube/kube-system/calico.yaml"
shell: "{{ bin_dir }}/kubectl apply -f {{ cluster_dir }}/yml/calico.yaml"
run_once: true
connection: local
# 删除原有cni配置
- name: 删除默认cni配置

View File

@ -12,12 +12,7 @@
- /etc/cni/net.d
- /var/run/cilium
- /opt/kube/images
- /opt/kube/kube-system
- name: 配置 cilium DaemonSet yaml文件
template: src=cilium.yaml.j2 dest=/opt/kube/kube-system/cilium.yaml
tags: reconf
- name: Optional-Mount BPF FS
mount:
fstype: "bpf"
@ -62,10 +57,17 @@
ignore_errors: true
when: "item in image_info.stdout and CONTAINER_RUNTIME == 'containerd'"
- name: 配置 cilium DaemonSet yaml文件
template: src=cilium.yaml.j2 dest={{ cluster_dir }}/yml/cilium.yaml
tags: reconf
run_once: true
connection: local
# 只需单节点执行一次
- name: 运行 cilium网络
shell: "{{ bin_dir }}/kubectl apply -f /opt/kube/kube-system/cilium.yaml"
shell: "{{ bin_dir }}/kubectl apply -f {{ cluster_dir }}/yml/cilium.yaml"
run_once: true
connection: local
# 删除原有cni配置
- name: 删除默认cni配置

View File

@ -22,7 +22,6 @@
- "/etc/systemd/system/kube-lb.service"
- "/etc/systemd/system/kubelet.service"
- "/etc/systemd/system/kube-proxy.service"
- "/opt/kube/kube-system/"
- "/etc/kube-lb/"
- "/etc/kubernetes/"
- "/root/.kube/config"
@ -123,7 +122,6 @@
- "/var/lib/cni/"
- "/var/lib/kube-router/"
- "/opt/kube/kube-ovn/"
- "/opt/kube/kube-system/"
- "/var/run/openvswitch/"
- "/etc/origin/openvswitch/"
- "/etc/openvswitch/"

View File

@ -59,14 +59,17 @@
# when: 'metallb_offline in image_info.stdout and CONTAINER_RUNTIME == "containerd"'
#
# - name: 生成 metallb 相关 manifests
# template: src=metallb/{{ item }}.j2 dest=/opt/kube/kube-system/{{ item }}
# template: src=metallb/{{ item }}.j2 dest={{ cluster_dir }}/yml/{{ item }}
# with_items:
# - "metallb.yaml"
# - "{{ metallb_protocol }}.yaml"
# run_once: true
# connection: local
#
# - name: 创建 metallb controller 部署
# shell: "{{ bin_dir }}/kubectl apply -f /opt/kube/kube-system/metallb.yaml && \
# {{ bin_dir }}/kubectl apply -f /opt/kube/kube-system/{{ metallb_protocol }}.yaml"
# shell: "{{ bin_dir }}/kubectl apply -f {{ cluster_dir }}/yml/metallb.yaml && \
# {{ bin_dir }}/kubectl apply -f {{ cluster_dir }}/yml/{{ metallb_protocol }}.yaml"
# run_once: true
# connection: local
# when: '"metallb" not in pod_info.stdout and metallb_install == "yes"'
# ignore_errors: true

View File

@ -36,7 +36,8 @@
file: name={{ item }} state=directory
with_items:
- "{{ bin_dir }}"
- /etc/docker
- "/etc/docker"
- "/etc/bash_completion.d"
- name: 下载 docker 二进制文件
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755

View File

@ -3,11 +3,7 @@
with_items:
- /etc/cni/net.d
- /opt/kube/images
- /opt/kube/kube-system
- name: 配置 flannel DaemonSet yaml文件
template: src=kube-flannel.yaml.j2 dest=/opt/kube/kube-system/flannel.yaml
- name: 下载flannel cni plugins
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755
with_items:
@ -54,10 +50,16 @@
ignore_errors: true
when: "item in image_info.stdout and CONTAINER_RUNTIME == 'containerd'"
- name: 配置 flannel DaemonSet yaml文件
template: src=kube-flannel.yaml.j2 dest={{ cluster_dir }}/yml/flannel.yaml
run_once: true
connection: local
# 只需单节点执行一次
- name: 运行 flannel网络
shell: "{{ bin_dir }}/kubectl apply -f /opt/kube/kube-system/flannel.yaml"
shell: "{{ bin_dir }}/kubectl apply -f {{ cluster_dir }}/yml/flannel.yaml"
run_once: true
connection: local
# 删除原有cni配置
- name: 删除默认cni配置

View File

@ -3,11 +3,7 @@
with_items:
- /etc/cni/net.d
- /opt/kube/images
- /opt/kube/kube-system
- name: 准备配置 kube-router DaemonSet (without IPVS)
template: src=kuberouter.yaml.j2 dest=/opt/kube/kube-system/kube-router.yaml
- name: 下载cni plugins
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755
with_items:
@ -56,10 +52,16 @@
ignore_errors: true
when: "item in image_info.stdout and CONTAINER_RUNTIME == 'containerd'"
- name: 准备配置 kube-router DaemonSet (without IPVS)
template: src=kuberouter.yaml.j2 dest={{ cluster_dir }}/yml/kube-router.yaml
run_once: true
connection: local
# 只需单节点执行一次
- name: 运行 kube-router DaemonSet
shell: "{{ bin_dir }}/kubectl apply -f /opt/kube/kube-system/kube-router.yaml"
shell: "{{ bin_dir }}/kubectl apply -f {{ cluster_dir }}/yml/kube-router.yaml"
run_once: true
connection: local
# 删除原有cni配置
- name: 删除默认cni配置