Add CRI-O CI (#5460)

pull/6003/head
Maxime Guyot 2020-04-22 15:09:52 +02:00 committed by GitHub
parent 1c187e9729
commit 09bccc97ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 109 additions and 10 deletions

View File

@ -27,6 +27,11 @@ packet_centos7-flannel-containerd-addons-ha:
stage: deploy-part2
when: on_success
packet_ubuntu18-crio:
extends: .packet
stage: deploy-part2
when: on_success
# ### MANUAL JOBS
packet_centos7-weave-upgrade-ha:

View File

@ -5,4 +5,4 @@ crio_seccomp_profile: "/etc/crio/seccomp.json"
crio_cgroup_manager: "{{ kubelet_cgroup_driver | default('cgroupfs') }}"
crio_runc_path: "/usr/sbin/runc"
crio_runc_path: "/usr/sbin/runc"

View File

@ -13,3 +13,4 @@
service:
name: crio
state: restarted
enabled: yes

View File

@ -0,0 +1,31 @@
---
driver:
name: vagrant
provider:
name: libvirt
lint:
name: yamllint
options:
config-file: ../../../.yamllint
platforms:
- name: kubespray-crio
box: generic/ubuntu1804
cpus: 2
memory: 1024
groups:
- kube-master
provisioner:
name: ansible
env:
ANSIBLE_ROLES_PATH: ../../../../
config_options:
defaults:
callback_whitelist: profile_tasks
lint:
name: ansible-lint
options:
c: ../../../.ansible-lint
verifier:
name: testinfra
lint:
name: flake8

View File

@ -0,0 +1,7 @@
---
- name: Converge
hosts: all
become: true
roles:
- role: kubespray-defaults
- role: cri-o

View File

@ -0,0 +1,6 @@
---
- name: Prepare
hosts: all
gather_facts: False
roles:
- role: bootstrap-os

View File

@ -0,0 +1,20 @@
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_service(host):
svc = host.service("crio")
assert svc.is_running
assert svc.is_enabled
def test_run(host):
path = "unix:///var/run/crio/crio.sock"
with host.sudo():
cmd = host.command("crictl --runtime-endpoint " + path + " version")
assert cmd.rc == 0
assert "RuntimeName: cri-o" in cmd.stdout

View File

@ -21,7 +21,15 @@
group: no
delegate_to: "{{ inventory_hostname }}"
- name: Install crictl completion
shell: "{{ bin_dir }}/crictl completion >/etc/bash_completion.d/crictl"
ignore_errors: True
- name: Get crictl completion
shell: "{{ bin_dir }}/crictl completion"
when: ansible_distribution in ["CentOS","RedHat", "Ubuntu", "Debian"]
changed_when: False
register: cri_completion
- name: Install crictl completion
copy:
dest: /etc/bash_completion.d/crictl
content: "{{ cri_completion.stdout }}"
become: True
when: cri_completion is defined

View File

@ -101,6 +101,14 @@
- is_ostree
- not need_bootstrap_crio.stat.exists
- name: Remove example CNI configs
file:
path: "/etc/cni/net.d/{{ item }}"
state: absent
loop:
- 100-crio-bridge.conf
- 200-loopback.conf
- name: Install cri-o config
template:
src: crio.conf.j2
@ -126,4 +134,4 @@
src: http-proxy.conf.j2
dest: /etc/systemd/system/crio.service.d/http-proxy.conf
notify: restart crio
when: http_proxy is defined or https_proxy is defined
when: http_proxy is defined or https_proxy is defined

View File

@ -281,7 +281,5 @@ network_dir = "/etc/cni/net.d/"
# Paths to directories where CNI plugin binaries are located.
plugin_dirs = [
"/usr/libexec/cni",
{% if ansible_os_family == "ClearLinux" or is_ostree %}
"/opt/cni/bin/",
{% endif %}
]

View File

@ -4,4 +4,5 @@ crio_packages:
- cri-tools
crio_conmon: /usr/libexec/crio/conmon
crio_seccomp_profile: ""
crio_runc_path: "/usr/bin/runc"
crio_seccomp_profile: ""

View File

@ -1,7 +1,7 @@
---
crio_packages:
- "cri-o-{{ kube_version | regex_replace('^v(?P<major>\\d+).(?P<minor>\\d+).(?P<patch>\\d+)$', '\\g<major>.\\g<minor>') }}"
- "cri-o-1.15"
crio_conmon: /usr/libexec/podman/conmon
crio_conmon: /usr/bin/conmon
crio_seccomp_profile: ""
crio_runc_path: /usr/lib/cri-o-runc/sbin/runc

View File

@ -0,0 +1,14 @@
---
# Instance settings
cloud_image: ubuntu-1804
mode: default
# Kubespray settings
deploy_netchecker: true
dns_min_replicas: 1
container_manager: crio
# CRI-O requirements
download_container: false
etcd_deployment_type: host
kubelet_deployment_type: host