fix: change cni bin directory t0 /opt/cni/bin #1248

pull/1252/head
gjmzj 2023-04-02 22:41:59 +08:00
parent e6c1215d62
commit 90764b968e
11 changed files with 15 additions and 28 deletions

View File

@ -442,7 +442,7 @@ spec:
# Used to install CNI.
- name: cni-bin-dir
hostPath:
path: {{ bin_dir }}
path: /opt/cni/bin
- name: cni-net-dir
hostPath:
path: /etc/cni/net.d

View File

@ -463,7 +463,7 @@ spec:
# Used to install CNI.
- name: cni-bin-dir
hostPath:
path: {{ bin_dir }}
path: /opt/cni/bin
- name: cni-net-dir
hostPath:
path: /etc/cni/net.d

View File

@ -521,7 +521,7 @@ spec:
# Used to install CNI.
- name: cni-bin-dir
hostPath:
path: {{ bin_dir }}
path: /opt/cni/bin
- name: cni-net-dir
hostPath:
path: /etc/cni/net.d

View File

@ -18,7 +18,7 @@ resources:
memory: 512Mi
cni:
binPath: {{ bin_dir }}
binPath: /opt/cni/bin
containerRuntime:
integration: containerd

View File

@ -69,7 +69,7 @@ version = 2
unset_seccomp_profile = ""
[plugins."io.containerd.grpc.v1.cri".cni]
bin_dir = "{{ bin_dir }}"
bin_dir = "/opt/cni/bin"
conf_dir = "/etc/cni/net.d"
conf_template = "/etc/cni/net.d/10-default.conf"
max_conf_num = 1

View File

@ -1,11 +1,3 @@
- name: 下载cni plugins
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755
with_items:
- bridge
- host-local
- loopback
- portmap
- name: 配置 flannel DaemonSet yaml文件
template: src=kube-flannel.yaml.j2 dest={{ cluster_dir }}/yml/flannel.yaml
run_once: true

View File

@ -184,7 +184,7 @@ spec:
path: /run/flannel
- name: cni-plugin
hostPath:
path: {{ bin_dir }}
path: /opt/cni/bin
- name: cni
hostPath:
path: /etc/cni/net.d

View File

@ -3,18 +3,22 @@
with_items:
- /var/lib/kubelet
- /var/lib/kube-proxy
- /etc/cni/net.d
- /opt/cni/bin
- name: 下载 kubelet,kube-proxy 二进制和基础 cni plugins
- name: 下载 kubelet,kube-proxy 二进制
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755
with_items:
- kubectl
- kubelet
- kube-proxy
- bridge
- host-local
- loopback
tags: upgrade_k8s
- name: 下载 cni plugins 二进制文件
copy: src={{ item }} dest=/opt/cni/bin/ mode=0755
with_fileglob:
- {{ base_dir }}/bin/cni-bin/*
- name: 添加 kubectl 自动补全
lineinfile:
dest: ~/.bashrc

View File

@ -214,7 +214,7 @@ spec:
path: /etc/cni/net.d
- name: cni-bin
hostPath:
path: {{ bin_dir }}
path: /opt/cni/bin
- name: host-ns
hostPath:
path: /var/run/netns

View File

@ -1,11 +1,3 @@
- name: 下载cni plugins
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755
with_items:
- bridge
- host-local
- loopback
- portmap
- name: 准备配置 kube-router DaemonSet (without IPVS)
template: src=kuberouter.yaml.j2 dest={{ cluster_dir }}/yml/kube-router.yaml
run_once: true

View File

@ -21,7 +21,6 @@
- "{{ bin_dir }}"
- "{{ ca_dir }}"
- /root/.kube
- /etc/cni/net.d
# 某些系统没有/usr/bin/python需要配置一个软链接否则connection: local的任务会失败
# 如果仍旧出现任务失败,重新执行一遍即可 https://github.com/ansible/ansible/issues/64903