Browse Source

Make vagrant CI normal (#6074)

pull/6206/head
Maxime Guyot 4 years ago
committed by GitHub
parent
commit
83d945127f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 34 additions and 10 deletions
  1. 8
      .gitlab-ci/vagrant.yml
  2. 2
      Vagrantfile
  3. 2
      docs/ci.md
  4. 8
      tests/Makefile
  5. 3
      tests/files/vagrant_ubuntu18-flannel.rb
  6. 7
      tests/files/vagrant_ubuntu18-flannel.yml
  7. 1
      tests/files/vagrant_ubuntu18-weave-medium.rb
  8. 7
      tests/files/vagrant_ubuntu18-weave-medium.yml
  9. 6
      tests/testcases/040_check-network-adv.yml

8
.gitlab-ci/vagrant.yml

@ -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

@ -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 = {}

2
docs/ci.md

@ -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

8
tests/Makefile

@ -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

3
tests/files/vagrant_ubuntu18-flannel.rb

@ -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

7
tests/files/vagrant_ubuntu18-flannel.yml

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

1
tests/files/vagrant_ubuntu18-weave-medium.rb

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

7
tests/files/vagrant_ubuntu18-weave-medium.yml

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

6
tests/testcases/040_check-network-adv.yml

@ -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)
Loading…
Cancel
Save