Make vagrant CI normal (#6074)

This commit is contained in:
Maxime Guyot 2020-05-28 09:46:02 +02:00 committed by GitHub
parent 1be15a0864
commit 83d945127f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 34 additions and 10 deletions

View file

@ -20,7 +20,7 @@ molecule_tests:
extends: .testcases
variables:
CI_PLATFORM: "vagrant"
SSH_USER: "kubespray"
SSH_USER: "vagrant"
VAGRANT_DEFAULT_PROVIDER: "libvirt"
KUBESPRAY_VAGRANT_CONFIG: tests/files/${CI_JOB_NAME}.rb
tags: [c3.small.x86]
@ -34,9 +34,9 @@ molecule_tests:
- python -m pip install -r tests/requirements.txt
- ./tests/scripts/vagrant_clean.sh
script:
- vagrant up
- ./tests/scripts/testcases_run.sh
after_script:
- vagrant destroy --force
- chronic ./tests/scripts/testcases_cleanup.sh
vagrant_ubuntu18-flannel:
stage: deploy-part2
@ -46,4 +46,4 @@ vagrant_ubuntu18-flannel:
vagrant_ubuntu18-weave-medium:
stage: deploy-part2
extends: .vagrant
when: manual
when: manual

2
Vagrantfile vendored
View file

@ -69,7 +69,7 @@ $disk_size ||= "20GB"
$local_path_provisioner_enabled ||= false
$local_path_provisioner_claim_root ||= "/opt/local-path-provisioner/"
$playbook = "cluster.yml"
$playbook ||= "cluster.yml"
host_vars = {}

View file

@ -16,7 +16,7 @@ fedora31 | :x: | :x: | :x: | :x: | :white_check_mark: | :x: | :x: | :x: | :x: |
opensuse | :x: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
oracle7 | :x: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
ubuntu16 | :x: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :x: | :white_check_mark: |
ubuntu18 | :white_check_mark: | :x: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: |
ubuntu18 | :white_check_mark: | :x: | :white_check_mark: | :x: | :white_check_mark: | :x: | :x: | :x: | :white_check_mark: |
ubuntu20 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
## crio

View file

@ -72,3 +72,11 @@ delete-packet:
-e @"files/${CI_JOB_NAME}.yml" \
-e test_id=$(TEST_ID) \
-e inventory_path=$(INVENTORY)
create-vagrant:
vagrant up
find / -name vagrant_ansible_inventory
cp /builds/kargo-ci/kubernetes-sigs-kubespray/inventory/sample/vagrant_ansible_inventory $(INVENTORY)
delete-vagrant:
vagrant destroy -f

View file

@ -3,4 +3,5 @@ $libvirt_volume_cache = "unsafe"
# Checking for box update can trigger API rate limiting
# https://www.vagrantup.com/docs/vagrant-cloud/request-limits.html
$box_check_update = false
$box_check_update = false
$vm_cpus = 2

View file

@ -0,0 +1,7 @@
---
# Kubespray settings
kube_network_plugin: flannel
deploy_netchecker: true
dns_min_replicas: 1

View file

@ -4,3 +4,4 @@ $os = "ubuntu1804"
$network_plugin = "weave"
$kube_master_instances = 1
$etcd_instances = 1
$playbook = "tests/cloud_playbooks/wait-for-ssh.yml"

View file

@ -0,0 +1,7 @@
---
# Kubespray settings
kube_network_plugin: weave
deploy_netchecker: true
dns_min_replicas: 1

View file

@ -188,7 +188,7 @@
EOF
when:
- inventory_hostname == groups['kube-master'][0]
- kube_network_plugin_multus|default(false)
- kube_network_plugin_multus|bool|default(false)
- name: Annotate pod with macvlan network
# We cannot use only shell: below because Ansible will render the text
@ -212,7 +212,7 @@
EOF
when:
- inventory_hostname == groups['kube-master'][0]
- kube_network_plugin_multus|default(false)
- kube_network_plugin_multus|bool|default(false)
- name: Check secondary macvlan interface
shell: "{{ bin_dir }}/kubectl exec samplepod -- ip addr show dev net1"
@ -222,4 +222,4 @@
changed_when: false
when:
- inventory_hostname == groups['kube-master'][0]
- kube_network_plugin_multus|default(false)
- kube_network_plugin_multus|bool|default(false)