From c6588856c791a01c708564bd0d8a04da32e8906e Mon Sep 17 00:00:00 2001 From: Maxime Guyot Date: Tue, 16 Jun 2020 22:04:05 +0200 Subject: [PATCH] Add Ubuntu 20.04 support and use Python 3 (#6157) --- .gitlab-ci/packet.yml | 2 +- .gitlab-ci/terraform.yml | 5 ++++- README.md | 2 +- Vagrantfile | 2 +- contrib/terraform/terraform.py | 8 +------- roles/bootstrap-os/molecule/default/molecule.yml | 8 ++++++-- roles/bootstrap-os/tasks/bootstrap-debian.yml | 7 ++++--- roles/kubernetes/node/vars/ubuntu-20.yml | 2 ++ .../image-builder/roles/kubevirt-images/defaults/main.yml | 6 +++--- tests/cloud_playbooks/roles/packet-ci/defaults/main.yml | 2 +- tests/files/packet_ubuntu20-calico-aio.yml | 6 +++++- 11 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 roles/kubernetes/node/vars/ubuntu-20.yml diff --git a/.gitlab-ci/packet.yml b/.gitlab-ci/packet.yml index 2983d4c0a..05a3feb03 100644 --- a/.gitlab-ci/packet.yml +++ b/.gitlab-ci/packet.yml @@ -18,7 +18,7 @@ packet_ubuntu18-calico-aio: packet_ubuntu20-calico-aio: stage: deploy-part1 extends: .packet - when: manual + when: on_success # ### PR JOBS PART2 diff --git a/.gitlab-ci/terraform.yml b/.gitlab-ci/terraform.yml index dce17f547..0bd133f0d 100644 --- a/.gitlab-ci/terraform.yml +++ b/.gitlab-ci/terraform.yml @@ -126,7 +126,9 @@ tf-validate-aws: OS_IDENTITY_API_VERSION: "3" TF_VAR_router_id: "ab95917c-41fb-4881-b507-3a6dfe9403df" # Since ELASTX is in Stockholm, Mitogen helps with latency - MITOGEN_ENABLE: "true" + MITOGEN_ENABLE: "false" + # Mitogen doesn't support interpreter discovery yet + ANSIBLE_PYTHON_INTERPRETER: "/usr/bin/python3" tf-elastx_cleanup: stage: unit-tests @@ -141,6 +143,7 @@ tf-elastx_cleanup: tf-elastx_ubuntu18-calico: extends: .terraform_apply + stage: deploy-part3 when: on_success variables: <<: *elastx_variables diff --git a/README.md b/README.md index f74994af3..226db6b64 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ vagrant up - **Container Linux by CoreOS** - **Debian** Buster, Jessie, Stretch, Wheezy -- **Ubuntu** 16.04, 18.04 +- **Ubuntu** 16.04, 18.04, 20.04 - **CentOS/RHEL** 7, 8 (experimental: see [centos 8 notes](docs/centos8.md)) - **Fedora** 30, 31 - **Fedora CoreOS** (experimental: see [fcos Note](docs/fcos.md)) diff --git a/Vagrantfile b/Vagrantfile index 22591415b..fa5e38fc0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -25,7 +25,7 @@ SUPPORTED_OS = { "flatcar-edge" => {box: "flatcar-edge", user: "core", box_url: FLATCAR_URL_TEMPLATE % ["edge"]}, "ubuntu1604" => {box: "generic/ubuntu1604", user: "vagrant"}, "ubuntu1804" => {box: "generic/ubuntu1804", user: "vagrant"}, - "ubuntu2004" => {box: "geerlingguy/ubuntu2004", user: "vagrant"}, + "ubuntu2004" => {box: "generic/ubuntu2004", user: "vagrant"}, "centos" => {box: "centos/7", user: "vagrant"}, "centos-bento" => {box: "bento/centos-7.6", user: "vagrant"}, "centos8" => {box: "centos/8", user: "vagrant"}, diff --git a/contrib/terraform/terraform.py b/contrib/terraform/terraform.py index 22c2a341d..96e57fa0a 100755 --- a/contrib/terraform/terraform.py +++ b/contrib/terraform/terraform.py @@ -319,9 +319,7 @@ def openstack_host(resource, module_name): # attrs specific to Mantl attrs.update({ - 'consul_dc': _clean_dc(attrs['metadata'].get('dc', module_name)), - 'role': attrs['metadata'].get('role', 'none'), - 'ansible_python_interpreter': attrs['metadata'].get('python_bin','python') + 'role': attrs['metadata'].get('role', 'none') }) # add groups based on attrs @@ -331,10 +329,6 @@ def openstack_host(resource, module_name): for item in list(attrs['metadata'].items())) groups.append('os_region=' + attrs['region']) - # groups specific to Mantl - groups.append('role=' + attrs['metadata'].get('role', 'none')) - groups.append('dc=' + attrs['consul_dc']) - # groups specific to kubespray for group in attrs['metadata'].get('kubespray_groups', "").split(","): groups.append(group) diff --git a/roles/bootstrap-os/molecule/default/molecule.yml b/roles/bootstrap-os/molecule/default/molecule.yml index 0528ebbb0..58f39aaf0 100644 --- a/roles/bootstrap-os/molecule/default/molecule.yml +++ b/roles/bootstrap-os/molecule/default/molecule.yml @@ -12,8 +12,12 @@ driver: platforms: - name: ubuntu18 box: generic/ubuntu1804 - cpus: 2 - memory: 2048 + cpus: 1 + memory: 512 + - name: ubuntu20 + box: generic/ubuntu2004 + cpus: 1 + memory: 512 provisioner: name: ansible lint: diff --git a/roles/bootstrap-os/tasks/bootstrap-debian.yml b/roles/bootstrap-os/tasks/bootstrap-debian.yml index 53d7288df..fa782b9cc 100644 --- a/roles/bootstrap-os/tasks/bootstrap-debian.yml +++ b/roles/bootstrap-os/tasks/bootstrap-debian.yml @@ -2,7 +2,7 @@ # Some Debian based distros ship without Python installed - name: Check if bootstrap is needed - raw: which python + raw: which python3 register: need_bootstrap failed_when: false changed_when: false @@ -77,10 +77,10 @@ - '"bionic" in os_release.stdout' - need_dnssec_allow_downgrade.rc -- name: Install python +- name: Install python3 raw: apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y python-minimal + DEBIAN_FRONTEND=noninteractive apt-get install -y python3-minimal become: true environment: {} when: @@ -91,4 +91,5 @@ package: name: dbus state: present + use: apt become: true diff --git a/roles/kubernetes/node/vars/ubuntu-20.yml b/roles/kubernetes/node/vars/ubuntu-20.yml new file mode 100644 index 000000000..59bc55dda --- /dev/null +++ b/roles/kubernetes/node/vars/ubuntu-20.yml @@ -0,0 +1,2 @@ +--- +kube_resolv_conf: "/run/systemd/resolve/resolv.conf" diff --git a/test-infra/image-builder/roles/kubevirt-images/defaults/main.yml b/test-infra/image-builder/roles/kubevirt-images/defaults/main.yml index 694b64024..8c5b3bf94 100644 --- a/test-infra/image-builder/roles/kubevirt-images/defaults/main.yml +++ b/test-infra/image-builder/roles/kubevirt-images/defaults/main.yml @@ -18,10 +18,10 @@ images: checksum: sha256:c3d0e03f4245ffaabd7647e6dabf346b944a62b9934d0a89f3a04b4236386af2 converted: false - ubuntu-2004-20200325: + ubuntu-2004: filename: focal-server-cloudimg-amd64.img - url: https://cloud-images.ubuntu.com/focal/20200325/focal-server-cloudimg-amd64.img - checksum: sha256:1b140c41cdd372b42d179111211a61f5b0f1c74ff9ef04be10806a083aba596c + url: https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-disk-kvm.img + checksum: sha256:8faf1f5a27c956ad0c49dac3114a355fbaf1b2d21709e10a18e67213fbb95b81 converted: false fedora-30: diff --git a/tests/cloud_playbooks/roles/packet-ci/defaults/main.yml b/tests/cloud_playbooks/roles/packet-ci/defaults/main.yml index 20915cc86..1b1bd79c5 100644 --- a/tests/cloud_playbooks/roles/packet-ci/defaults/main.yml +++ b/tests/cloud_playbooks/roles/packet-ci/defaults/main.yml @@ -30,5 +30,5 @@ cloud_init: amazon-linux-2: "I2Nsb3VkLWNvbmZpZwpzeXN0ZW1faW5mbzoKICBkaXN0cm86IHJoZWwKdXNlcnM6CiAtIG5hbWU6IGt1YmVzcHJheQogICBncm91cHM6IHdoZWVsCiAgIHN1ZG86ICdBTEw9KEFMTCkgTk9QQVNTV0Q6QUxMJwogICBzaGVsbDogL2Jpbi9iYXNoCiAgIGxvY2tfcGFzc3dkOiBGYWxzZQogICBob21lOiAvaG9tZS9rdWJlc3ByYXkKICAgc3NoX2F1dGhvcml6ZWRfa2V5czoKICAgICAtIHNzaC1yc2EgQUFBQUIzTnphQzF5YzJFQUFBQURBUUFCQUFBQkFRQ2FuVGkvZUt4MCt0SFlKQWVEaHErc0ZTMk9iVVAxL0k2OWY3aVYzVXRrS2xUMjBKZlcxZjZGZVh0LzA0VmYyN1dRcStOcXM2dkdCcUQ5UVhTWXVmK3QwL3M3RVBMalRlaTltZTFtcHFyK3VUZStLRHRUUDM5cGZEMy9lVkNhZUI3MjZHUDJGa2FEMEZ6cG1FYjY2TzNOcWh4T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em95Vnd0VnZmRFF6c204ZnEzYXY0S3ZlejhrWXVOREp2MDV4NGx2VVpnUjE1WkRSWHNBbmRoUXlxb1hkQ0xBZTArZWFLWHE5QmtXeEtGYjloUGUwQVVqamE1" oracle-7: "I2Nsb3VkLWNvbmZpZwpzeXN0ZW1faW5mbzoKICBkaXN0cm86IGZlZG9yYQp1c2VyczoKIC0gbmFtZToga3ViZXNwcmF5CiAgIGdyb3Vwczogd2hlZWwKICAgc3VkbzogJ0FMTD0oQUxMKSBOT1BBU1NXRDpBTEwnCiAgIHNoZWxsOiAvYmluL2Jhc2gKICAgbG9ja19wYXNzd2Q6IEZhbHNlCiAgIGhvbWU6IC9ob21lL2t1YmVzcHJheQogICBzc2hfYXV0aG9yaXplZF9rZXlzOgogICAgIC0gc3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDYW5UaS9lS3gwK3RIWUpBZURocStzRlMyT2JVUDEvSTY5ZjdpVjNVdGtLbFQyMEpmVzFmNkZlWHQvMDRWZjI3V1FxK05xczZ2R0JxRDlRWFNZdWYrdDAvczdFUExqVGVpOW1lMW1wcXIrdVRlK0tEdFRQMzlwZkQzL2VWQ2FlQjcyNkdQMkZrYUQwRnpwbUViNjZPM05xaHhPUTk2R3gvOVhUdXcvSzNsbGo0T1ZENkdyalIzQjdjNFh0RUJzWmNacHBNSi9vSDFtR3lHWGRoMzFtV1FTcUFSTy9QOFU4R3d0MCtIR3BVd2gvaGR5M3QrU1lvVEIyR3dWYjB6b3lWd3RWdmZEUXpzbThmcTNhdjRLdmV6OGtZdU5ESnYwNXg0bHZVWmdSMTVaRFJYc0FuZGhReXFvWGRDTEFlMCtlYUtYcTlCa1d4S0ZiOWhQZTBBVWpqYTU=" diff --git a/tests/files/packet_ubuntu20-calico-aio.yml b/tests/files/packet_ubuntu20-calico-aio.yml index 2862f5cd3..7f0b73ad7 100644 --- a/tests/files/packet_ubuntu20-calico-aio.yml +++ b/tests/files/packet_ubuntu20-calico-aio.yml @@ -1,6 +1,6 @@ --- # Instance settings -cloud_image: ubuntu-2004-20200325 +cloud_image: ubuntu-2004 mode: aio vm_memory: 1600Mi @@ -8,3 +8,7 @@ vm_memory: 1600Mi kube_network_plugin: calico deploy_netchecker: true dns_min_replicas: 1 + +# Currently ipvs not available on KVM: https://packages.ubuntu.com/search?suite=focal&arch=amd64&mode=exactfilename&searchon=contents&keywords=ip_vs_sh.ko +kube_proxy_mode: iptables +enable_nodelocaldns: False