Fix multus missing cni and erroneous CI tests (#6051)

This commit is contained in:
Florian Ruynat 2020-05-01 08:38:05 +02:00 committed by GitHub
parent 353d44a4a6
commit 361645e8b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 25 deletions

View file

@ -17,3 +17,12 @@ rules:
verbs: verbs:
- get - get
- update - update
- apiGroups:
- ""
- events.k8s.io
resources:
- events
verbs:
- create
- patch
- update

View file

@ -0,0 +1,3 @@
---
dependencies:
- role: network_plugin/cni

View file

@ -43,10 +43,10 @@ spec:
resources: resources:
requests: requests:
cpu: "100m" cpu: "100m"
memory: "50Mi" memory: "90Mi"
limits: limits:
cpu: "100m" cpu: "100m"
memory: "50Mi" memory: "90Mi"
securityContext: securityContext:
privileged: true privileged: true
{% if container_manager == 'crio' %} {% if container_manager == 'crio' %}

View file

@ -35,22 +35,20 @@
- name: Wait for netchecker server - name: Wait for netchecker server
shell: "{{ bin_dir }}/kubectl get pods -o wide --namespace {{ netcheck_namespace }} | grep ^netchecker-server" shell: "{{ bin_dir }}/kubectl get pods -o wide --namespace {{ netcheck_namespace }} | grep ^netchecker-server"
delegate_to: "{{ groups['kube-master'][0] }}"
run_once: true
register: ncs_pod register: ncs_pod
until: ncs_pod.stdout.find('Running') != -1 until: ncs_pod.stdout.find('Running') != -1
retries: 3 retries: 3
delay: 10 delay: 10
when: inventory_hostname == groups['kube-master'][0]
- name: Wait for netchecker agents - name: Wait for netchecker agents
shell: "{{ bin_dir }}/kubectl get pods -o wide --namespace {{ netcheck_namespace }} | grep '^netchecker-agent-.*Running'" shell: "{{ bin_dir }}/kubectl get pods -o wide --namespace {{ netcheck_namespace }} | grep '^netchecker-agent-.*Running'"
run_once: true
delegate_to: "{{ groups['kube-master'][0] }}"
register: nca_pod register: nca_pod
until: nca_pod.stdout_lines|length >= groups['k8s-cluster']|intersect(ansible_play_hosts)|length * 2 until: nca_pod.stdout_lines|length >= groups['k8s-cluster']|intersect(ansible_play_hosts)|length * 2
retries: 3 retries: 3
delay: 10 delay: 10
failed_when: false failed_when: false
when: inventory_hostname == groups['kube-master'][0]
- name: Get netchecker pods - name: Get netchecker pods
command: "{{ bin_dir }}/kubectl -n {{ netcheck_namespace }} describe pod -l app={{ item }}" command: "{{ bin_dir }}/kubectl -n {{ netcheck_namespace }} describe pod -l app={{ item }}"
@ -115,16 +113,16 @@
- name: Get kube-proxy logs - name: Get kube-proxy logs
command: "{{ bin_dir }}/kubectl -n kube-system logs -l k8s-app=kube-proxy" command: "{{ bin_dir }}/kubectl -n kube-system logs -l k8s-app=kube-proxy"
run_once: true
when: not result is success
delegate_to: "{{ groups['kube-master'][0] }}"
no_log: false no_log: false
when:
- inventory_hostname == groups['kube-master'][0]
- not result is success
- name: Get logs from other apps - name: Get logs from other apps
command: "{{ bin_dir }}/kubectl -n kube-system logs -l k8s-app={{ item }} --all-containers" command: "{{ bin_dir }}/kubectl -n kube-system logs -l k8s-app={{ item }} --all-containers"
run_once: true when:
when: not result is success - inventory_hostname == groups['kube-master'][0]
delegate_to: "{{ groups['kube-master'][0] }}" - not result is success
no_log: false no_log: false
with_items: with_items:
- kube-router - kube-router
@ -189,6 +187,7 @@
}' }'
EOF EOF
when: when:
- inventory_hostname == groups['kube-master'][0]
- kube_network_plugin_multus|default(false) - kube_network_plugin_multus|default(false)
- name: Annotate pod with macvlan network - name: Annotate pod with macvlan network
@ -212,6 +211,7 @@
image: dougbtv/centos-network image: dougbtv/centos-network
EOF EOF
when: when:
- inventory_hostname == groups['kube-master'][0]
- kube_network_plugin_multus|default(false) - kube_network_plugin_multus|default(false)
- name: Check secondary macvlan interface - name: Check secondary macvlan interface
@ -221,4 +221,5 @@
retries: 90 retries: 90
changed_when: false changed_when: false
when: when:
- inventory_hostname == groups['kube-master'][0]
- kube_network_plugin_multus|default(false) - kube_network_plugin_multus|default(false)