From b45f3f0004a612d30e7262b2a4559fed7b6ccad5 Mon Sep 17 00:00:00 2001 From: Maxime Guyot Date: Tue, 28 May 2019 10:51:53 +0200 Subject: [PATCH] Add tf-ovh_coreos CI job (#4763) --- .gitlab-ci/terraform.yml | 33 ++++++++++++++++++++++++- roles/kubernetes/kubeadm/tasks/main.yml | 2 +- tests/files/tf-ovh_coreos-calico.yml | 5 ++++ tests/scripts/testcases_run.sh | 9 +++++-- 4 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 tests/files/tf-ovh_coreos-calico.yml diff --git a/.gitlab-ci/terraform.yml b/.gitlab-ci/terraform.yml index 513e1960d..0b7c75f93 100644 --- a/.gitlab-ci/terraform.yml +++ b/.gitlab-ci/terraform.yml @@ -35,6 +35,7 @@ ANSIBLE_INVENTORY_UNPARSED_FAILED: "true" ANSIBLE_INVENTORY: hosts CI_PLATFORM: tf + TF_VAR_ssh_user: $SSH_USER script: - tests/scripts/testcases_run.sh after_script: @@ -113,7 +114,7 @@ tf-ovh_ubuntu18-calico: CLUSTER: $CI_COMMIT_REF_NAME ANSIBLE_TIMEOUT: "60" SSH_USER: ubuntu - TF_VAR_cluster_name: $CI_COMMIT_REF_SLUG + TF_VAR_cluster_name: $CI_COMMIT_REF_SLUG-$CI_JOB_ID TF_VAR_number_of_k8s_masters: "0" TF_VAR_number_of_k8s_masters_no_floating_ip: "1" TF_VAR_number_of_k8s_masters_no_floating_ip_no_etcd: "0" @@ -131,3 +132,33 @@ tf-ovh_ubuntu18-calico: TF_VAR_flavor_k8s_node: "defa64c3-bd46-43b4-858a-d93bbae0a229" # s1-8 TF_VAR_image: "Ubuntu 18.04" TF_VAR_k8s_allowed_remote_ips: '["0.0.0.0/0"]' + +tf-ovh_coreos-calico: + extends: .terraform_apply + stage: unit-tests + when: on_success + variables: + <<: *ovh_variables + TF_VERSION: 0.11.11 + PROVIDER: openstack + CLUSTER: $CI_COMMIT_REF_NAME + ANSIBLE_TIMEOUT: "60" + SSH_USER: core + TF_VAR_cluster_name: $CI_COMMIT_REF_SLUG-$CI_JOB_ID + TF_VAR_number_of_k8s_masters: "0" + TF_VAR_number_of_k8s_masters_no_floating_ip: "1" + TF_VAR_number_of_k8s_masters_no_floating_ip_no_etcd: "0" + TF_VAR_number_of_etcd: "0" + TF_VAR_number_of_k8s_nodes: "0" + TF_VAR_number_of_k8s_nodes_no_floating_ip: "1" + TF_VAR_number_of_gfs_nodes_no_floating_ip: "0" + TF_VAR_number_of_bastions: "0" + TF_VAR_number_of_k8s_masters_no_etcd: "0" + TF_VAR_use_neutron: "0" + TF_VAR_floatingip_pool: "Ext-Net" + TF_VAR_external_net: "6011fbc9-4cbf-46a4-8452-6890a340b60b" + TF_VAR_network_name: "Ext-Net" + TF_VAR_flavor_k8s_master: "4d4fd037-9493-4f2b-9afe-b542b5248eac" # b2-7 + TF_VAR_flavor_k8s_node: "4d4fd037-9493-4f2b-9afe-b542b5248eac" # b2-7 + TF_VAR_image: "CoreOS Stable" + TF_VAR_k8s_allowed_remote_ips: '["0.0.0.0/0"]' diff --git a/roles/kubernetes/kubeadm/tasks/main.yml b/roles/kubernetes/kubeadm/tasks/main.yml index dec1ce6d9..2e5c8dda7 100644 --- a/roles/kubernetes/kubeadm/tasks/main.yml +++ b/roles/kubernetes/kubeadm/tasks/main.yml @@ -91,7 +91,7 @@ --config {{ kube_config_dir }}/kubeadm-client.conf --ignore-preflight-errors=all register: kubeadm_join - async: 60 + async: 180 poll: 15 always: diff --git a/tests/files/tf-ovh_coreos-calico.yml b/tests/files/tf-ovh_coreos-calico.yml new file mode 100644 index 000000000..19a92d7d3 --- /dev/null +++ b/tests/files/tf-ovh_coreos-calico.yml @@ -0,0 +1,5 @@ +--- +dns_min_replicas: 1 +deploy_netchecker: true + +# resolvconf_mode: host_resolvconf # this is required as long as the coreos stable channel uses docker < 1.12 diff --git a/tests/scripts/testcases_run.sh b/tests/scripts/testcases_run.sh index 015e5c880..4c34ec258 100755 --- a/tests/scripts/testcases_run.sh +++ b/tests/scripts/testcases_run.sh @@ -15,6 +15,11 @@ export ANSIBLE_BECOME_USER=root cd tests && make create-${CI_PLATFORM} -s ; cd - ansible-playbook tests/cloud_playbooks/wait-for-ssh.yml +# CoreOS needs auto update disabled +if [[ "$CI_JOB_NAME" =~ "coreos" ]]; then + ansible all -m raw -a 'systemctl disable locksmithd' + ansible all -m raw -a 'systemctl stop locksmithd' +fi # Check out latest tag if testing upgrade test "${UPGRADE_TEST}" != "false" && git fetch --all && git checkout "$KUBESPRAY_VERSION" @@ -22,14 +27,14 @@ test "${UPGRADE_TEST}" != "false" && git fetch --all && git checkout "$KUBESPRAY test "${UPGRADE_TEST}" != "false" && git checkout "${CI_BUILD_REF}" tests/files/${CI_JOB_NAME}.yml # Create cluster -ansible-playbook ${LOG_LEVEL} -e @${CI_TEST_VARS} -e ansible_ssh_user=${SSH_USER} -e local_release_dir=${PWD}/downloads --limit "all:!fake_hosts" cluster.yml +ansible-playbook ${LOG_LEVEL} -e @${CI_TEST_VARS} -e local_release_dir=${PWD}/downloads --limit "all:!fake_hosts" cluster.yml # Repeat deployment if testing upgrade if [ "${UPGRADE_TEST}" != "false" ]; then test "${UPGRADE_TEST}" == "basic" && PLAYBOOK="cluster.yml" test "${UPGRADE_TEST}" == "graceful" && PLAYBOOK="upgrade-cluster.yml" git checkout "${CI_BUILD_REF}" - ansible-playbook ${LOG_LEVEL} -e @${CI_TEST_VARS} -e ansible_ssh_user=${SSH_USER} -e local_release_dir=${PWD}/downloads --limit "all:!fake_hosts" $PLAYBOOK + ansible-playbook ${LOG_LEVEL} -e @${CI_TEST_VARS} -e local_release_dir=${PWD}/downloads --limit "all:!fake_hosts" $PLAYBOOK fi # Tests Cases