Add CRI-O CI (#5460)
This commit is contained in:
parent
1c187e9729
commit
09bccc97ba
13 changed files with 109 additions and 10 deletions
|
@ -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:
|
||||
|
|
|
@ -13,3 +13,4 @@
|
|||
service:
|
||||
name: crio
|
||||
state: restarted
|
||||
enabled: yes
|
||||
|
|
31
roles/container-engine/cri-o/molecule/default/molecule.yml
Normal file
31
roles/container-engine/cri-o/molecule/default/molecule.yml
Normal 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
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
roles:
|
||||
- role: kubespray-defaults
|
||||
- role: cri-o
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- name: Prepare
|
||||
hosts: all
|
||||
gather_facts: False
|
||||
roles:
|
||||
- role: bootstrap-os
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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 %}
|
||||
]
|
||||
|
|
|
@ -4,4 +4,5 @@ crio_packages:
|
|||
- cri-tools
|
||||
|
||||
crio_conmon: /usr/libexec/crio/conmon
|
||||
crio_runc_path: "/usr/bin/runc"
|
||||
crio_seccomp_profile: ""
|
|
@ -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
|
||||
|
|
14
tests/files/packet_ubuntu18-crio.yml
Normal file
14
tests/files/packet_ubuntu18-crio.yml
Normal 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
|
Loading…
Reference in a new issue