Maxime Guyot
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with
22 additions and
136 deletions
-
roles/kubernetes-apps/network_plugin/cni/tasks/main.yml
-
roles/kubernetes-apps/network_plugin/meta/main.yml
-
roles/network_plugin/cilium/meta/main.yml
-
roles/network_plugin/cilium/tasks/main.yml
-
roles/network_plugin/cloud/tasks/main.yml
-
roles/network_plugin/cni/tasks/main.yml
-
roles/network_plugin/contiv/meta/main.yml
-
roles/network_plugin/contiv/tasks/main.yml
-
roles/network_plugin/flannel/meta/main.yml
-
roles/network_plugin/flannel/tasks/main.yml
-
roles/network_plugin/kube-router/meta/main.yml
-
roles/network_plugin/kube-router/tasks/main.yml
-
roles/network_plugin/macvlan/meta/main.yml
-
roles/network_plugin/macvlan/tasks/main.yml
-
roles/network_plugin/meta/main.yml
-
roles/network_plugin/weave/meta/main.yml
-
roles/network_plugin/weave/tasks/main.yml
|
@ -1,14 +0,0 @@ |
|
|
--- |
|
|
|
|
|
- name: CNI | make sure /opt/cni/bin exists |
|
|
|
|
|
file: |
|
|
|
|
|
path: /opt/cni/bin |
|
|
|
|
|
state: directory |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
owner: root |
|
|
|
|
|
group: root |
|
|
|
|
|
- name: CNI | Copy cni plugins |
|
|
|
|
|
unarchive: |
|
|
|
|
|
src: "{{ local_release_dir }}/cni-plugins-linux-{{ image_arch }}-{{ cni_version }}.tgz" |
|
|
|
|
|
dest: "/opt/cni/bin" |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
remote_src: yes |
|
|
|
|
@ -25,11 +25,6 @@ dependencies: |
|
|
tags: |
|
|
tags: |
|
|
- contiv |
|
|
- contiv |
|
|
|
|
|
|
|
|
- role: kubernetes-apps/network_plugin/cni |
|
|
|
|
|
when: kube_network_plugin == 'cni' |
|
|
|
|
|
tags: |
|
|
|
|
|
- cni |
|
|
|
|
|
|
|
|
|
|
|
- role: kubernetes-apps/network_plugin/kube-ovn |
|
|
- role: kubernetes-apps/network_plugin/kube-ovn |
|
|
when: kube_network_plugin == 'kube-ovn' |
|
|
when: kube_network_plugin == 'kube-ovn' |
|
|
tags: |
|
|
tags: |
|
|
|
@ -0,0 +1,3 @@ |
|
|
|
|
|
--- |
|
|
|
|
|
dependencies: |
|
|
|
|
|
- role: network_plugin/cni |
|
@ -40,23 +40,6 @@ |
|
|
when: |
|
|
when: |
|
|
- inventory_hostname in groups['kube-master'] |
|
|
- inventory_hostname in groups['kube-master'] |
|
|
|
|
|
|
|
|
- name: Cilium | Set CNI directory permissions |
|
|
|
|
|
file: |
|
|
|
|
|
path: /opt/cni/bin |
|
|
|
|
|
state: directory |
|
|
|
|
|
owner: kube |
|
|
|
|
|
recurse: true |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
register: cni_bin_dir |
|
|
|
|
|
|
|
|
|
|
|
- name: Cilium | Copy CNI plugins |
|
|
|
|
|
unarchive: |
|
|
|
|
|
src: "{{ local_release_dir }}/cni-plugins-linux-{{ image_arch }}-{{ cni_version }}.tgz" |
|
|
|
|
|
dest: "/opt/cni/bin" |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
remote_src: yes |
|
|
|
|
|
when: cilium_enable_portmap |
|
|
|
|
|
|
|
|
|
|
|
- name: Cilium | Enable portmap addon |
|
|
- name: Cilium | Enable portmap addon |
|
|
template: |
|
|
template: |
|
|
src: 000-cilium-portmap.conflist.j2 |
|
|
src: 000-cilium-portmap.conflist.j2 |
|
|
|
@ -1,15 +0,0 @@ |
|
|
--- |
|
|
|
|
|
- name: Cloud | Set cni directory permissions |
|
|
|
|
|
file: |
|
|
|
|
|
path: /opt/cni/bin |
|
|
|
|
|
state: directory |
|
|
|
|
|
owner: kube |
|
|
|
|
|
recurse: true |
|
|
|
|
|
mode: "u=rwX,g-rwx,o-rwx" |
|
|
|
|
|
|
|
|
|
|
|
- name: Canal | Copy cni plugins |
|
|
|
|
|
unarchive: |
|
|
|
|
|
src: "{{ local_release_dir }}/cni-plugins-linux-{{ image_arch }}-{{ cni_version }}.tgz" |
|
|
|
|
|
dest: "/opt/cni/bin" |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
remote_src: yes |
|
|
|
|
@ -4,8 +4,9 @@ |
|
|
path: /opt/cni/bin |
|
|
path: /opt/cni/bin |
|
|
state: directory |
|
|
state: directory |
|
|
mode: 0755 |
|
|
mode: 0755 |
|
|
owner: root |
|
|
|
|
|
group: root |
|
|
|
|
|
|
|
|
owner: kube |
|
|
|
|
|
recurse: true |
|
|
|
|
|
|
|
|
- name: CNI | Copy cni plugins |
|
|
- name: CNI | Copy cni plugins |
|
|
unarchive: |
|
|
unarchive: |
|
|
src: "{{ local_release_dir }}/cni-plugins-linux-{{ image_arch }}-{{ cni_version }}.tgz" |
|
|
src: "{{ local_release_dir }}/cni-plugins-linux-{{ image_arch }}-{{ cni_version }}.tgz" |
|
|
|
@ -0,0 +1,3 @@ |
|
|
|
|
|
--- |
|
|
|
|
|
dependencies: |
|
|
|
|
|
- role: network_plugin/cni |
|
@ -144,21 +144,6 @@ |
|
|
- contiv_enable_api_proxy |
|
|
- contiv_enable_api_proxy |
|
|
- contiv_generate_certificate |
|
|
- contiv_generate_certificate |
|
|
|
|
|
|
|
|
- name: Contiv | Set cni directory permissions |
|
|
|
|
|
file: |
|
|
|
|
|
path: /opt/cni/bin |
|
|
|
|
|
state: directory |
|
|
|
|
|
owner: kube |
|
|
|
|
|
recurse: true |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
|
|
|
|
|
|
- name: Contiv | Copy cni plugins |
|
|
|
|
|
unarchive: |
|
|
|
|
|
src: "{{ local_release_dir }}/cni-plugins-linux-{{ image_arch }}-{{ cni_version }}.tgz" |
|
|
|
|
|
dest: "/opt/cni/bin" |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
remote_src: yes |
|
|
|
|
|
|
|
|
|
|
|
- name: Contiv | Copy netctl binary from docker container |
|
|
- name: Contiv | Copy netctl binary from docker container |
|
|
command: sh -c "{{ docker_bin_dir }}/docker rm -f netctl-binarycopy; |
|
|
command: sh -c "{{ docker_bin_dir }}/docker rm -f netctl-binarycopy; |
|
|
{{ docker_bin_dir }}/docker create --name netctl-binarycopy {{ contiv_image_repo }}:{{ contiv_image_tag }} && |
|
|
{{ docker_bin_dir }}/docker create --name netctl-binarycopy {{ contiv_image_repo }}:{{ contiv_image_tag }} && |
|
|
|
@ -0,0 +1,3 @@ |
|
|
|
|
|
--- |
|
|
|
|
|
dependencies: |
|
|
|
|
|
- role: network_plugin/cni |
|
@ -9,19 +9,3 @@ |
|
|
register: flannel_node_manifests |
|
|
register: flannel_node_manifests |
|
|
when: |
|
|
when: |
|
|
- inventory_hostname in groups['kube-master'] |
|
|
- inventory_hostname in groups['kube-master'] |
|
|
|
|
|
|
|
|
- name: Flannel | Set CNI directory permissions |
|
|
|
|
|
file: |
|
|
|
|
|
path: /opt/cni/bin |
|
|
|
|
|
state: directory |
|
|
|
|
|
owner: kube |
|
|
|
|
|
recurse: true |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
register: cni_bin_dir |
|
|
|
|
|
|
|
|
|
|
|
- name: Flannel | Copy CNI plugins |
|
|
|
|
|
unarchive: |
|
|
|
|
|
src: "{{ local_release_dir }}/cni-plugins-linux-{{ image_arch }}-{{ cni_version }}.tgz" |
|
|
|
|
|
dest: "/opt/cni/bin" |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
remote_src: yes |
|
|
|
|
@ -0,0 +1,3 @@ |
|
|
|
|
|
--- |
|
|
|
|
|
dependencies: |
|
|
|
|
|
- role: network_plugin/cni |
|
@ -3,22 +3,6 @@ |
|
|
include: annotate.yml |
|
|
include: annotate.yml |
|
|
tags: annotate |
|
|
tags: annotate |
|
|
|
|
|
|
|
|
- name: kube-router | Set cni directory permissions |
|
|
|
|
|
file: |
|
|
|
|
|
path: /opt/cni/bin |
|
|
|
|
|
state: directory |
|
|
|
|
|
owner: kube |
|
|
|
|
|
recurse: true |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
|
|
|
|
|
|
- name: kube-router | Copy cni plugins |
|
|
|
|
|
unarchive: |
|
|
|
|
|
src: "{{ local_release_dir }}/cni-plugins-linux-{{ image_arch }}-{{ cni_version }}.tgz" |
|
|
|
|
|
dest: "/opt/cni/bin" |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
owner: kube |
|
|
|
|
|
remote_src: yes |
|
|
|
|
|
|
|
|
|
|
|
- name: kube-router | Create config directory |
|
|
- name: kube-router | Create config directory |
|
|
file: |
|
|
file: |
|
|
path: /var/lib/kube-router |
|
|
path: /var/lib/kube-router |
|
|
|
@ -0,0 +1,3 @@ |
|
|
|
|
|
--- |
|
|
|
|
|
dependencies: |
|
|
|
|
|
- role: network_plugin/cni |
|
@ -1,20 +1,4 @@ |
|
|
--- |
|
|
--- |
|
|
|
|
|
|
|
|
- name: Macvlan | Set cni directory permissions |
|
|
|
|
|
file: |
|
|
|
|
|
path: /opt/cni/bin |
|
|
|
|
|
state: directory |
|
|
|
|
|
owner: kube |
|
|
|
|
|
recurse: true |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
|
|
|
|
|
|
- name: Macvlan | Copy cni plugins |
|
|
|
|
|
unarchive: |
|
|
|
|
|
src: "{{ local_release_dir }}/cni-plugins-linux-{{ image_arch }}-{{ cni_version }}.tgz" |
|
|
|
|
|
dest: "/opt/cni/bin" |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
remote_src: yes |
|
|
|
|
|
|
|
|
|
|
|
- name: Macvlan | Retrieve Pod Cidr |
|
|
- name: Macvlan | Retrieve Pod Cidr |
|
|
command: "{{ bin_dir }}/kubectl get nodes {{ kube_override_hostname | default(inventory_hostname) }} -o jsonpath='{.spec.podCIDR}'" |
|
|
command: "{{ bin_dir }}/kubectl get nodes {{ kube_override_hostname | default(inventory_hostname) }} -o jsonpath='{.spec.podCIDR}'" |
|
|
register: node_pod_cidr_cmd |
|
|
register: node_pod_cidr_cmd |
|
|
|
@ -26,7 +26,7 @@ dependencies: |
|
|
- canal |
|
|
- canal |
|
|
|
|
|
|
|
|
- role: network_plugin/cni |
|
|
- role: network_plugin/cni |
|
|
when: kube_network_plugin == 'cni' |
|
|
|
|
|
|
|
|
when: kube_network_plugin in ['cni', 'cloud'] |
|
|
tags: |
|
|
tags: |
|
|
- cni |
|
|
- cni |
|
|
|
|
|
|
|
@ -50,9 +50,6 @@ dependencies: |
|
|
tags: |
|
|
tags: |
|
|
- kube-router |
|
|
- kube-router |
|
|
|
|
|
|
|
|
- role: network_plugin/cloud |
|
|
|
|
|
when: kube_network_plugin == 'cloud' |
|
|
|
|
|
|
|
|
|
|
|
- role: network_plugin/multus |
|
|
- role: network_plugin/multus |
|
|
when: kube_network_plugin_multus |
|
|
when: kube_network_plugin_multus |
|
|
tags: |
|
|
tags: |
|
|
|
@ -0,0 +1,3 @@ |
|
|
|
|
|
--- |
|
|
|
|
|
dependencies: |
|
|
|
|
|
- role: network_plugin/cni |
|
@ -1,20 +1,4 @@ |
|
|
--- |
|
|
--- |
|
|
|
|
|
|
|
|
- name: Weave | Set cni directory permissions |
|
|
|
|
|
file: |
|
|
|
|
|
path: /opt/cni/bin |
|
|
|
|
|
state: directory |
|
|
|
|
|
owner: kube |
|
|
|
|
|
recurse: true |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
|
|
|
|
|
|
- name: Weave | Copy cni plugins |
|
|
|
|
|
unarchive: |
|
|
|
|
|
src: "{{ local_release_dir }}/cni-plugins-linux-{{ image_arch }}-{{ cni_version }}.tgz" |
|
|
|
|
|
dest: "/opt/cni/bin" |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
remote_src: yes |
|
|
|
|
|
|
|
|
|
|
|
- name: Weave | Create manifest |
|
|
- name: Weave | Create manifest |
|
|
template: |
|
|
template: |
|
|
src: weave-net.yml.j2 |
|
|
src: weave-net.yml.j2 |
|
|