Browse Source

CI: Document the 'all-in-one' layout + small refactoring (#10725)

* Rename aio to all-in-one and document it

ADTM.
Acronyms don't tell much.

* Refactor vm_count in tests provisioning
pull/10723/head
Max Gautier 11 months ago
committed by GitHub
parent
commit
7395c27932
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 34 additions and 24 deletions
  1. 14
      .gitlab-ci/packet.yml
  2. 4
      docs/test_cases.md
  3. 2
      tests/cloud_playbooks/create-gce.yml
  4. 2
      tests/cloud_playbooks/roles/packet-ci/defaults/main.yml
  5. 4
      tests/cloud_playbooks/roles/packet-ci/tasks/main.yml
  6. 2
      tests/cloud_playbooks/roles/packet-ci/templates/inventory.j2
  7. 12
      tests/cloud_playbooks/roles/packet-ci/vars/main.yml
  8. 2
      tests/files/packet_amazon-linux-2-all-in-one.yml
  9. 2
      tests/files/packet_ubuntu20-all-in-one-docker.yml
  10. 1
      tests/files/packet_ubuntu20-calico-aio-ansible-2_11.yml
  11. 1
      tests/files/packet_ubuntu20-calico-all-in-one-ansible-2_11.yml
  12. 2
      tests/files/packet_ubuntu20-calico-all-in-one-hardening.yml
  13. 2
      tests/files/packet_ubuntu20-calico-all-in-one.yml
  14. 2
      tests/files/packet_ubuntu22-all-in-one-docker.yml
  15. 2
      tests/files/packet_ubuntu22-calico-all-in-one.yml
  16. 4
      tests/templates/inventory-gce.j2

14
.gitlab-ci/packet.yml

@ -31,8 +31,8 @@ packet_cleanup_old:
- make cleanup-packet - make cleanup-packet
after_script: [] after_script: []
# The ubuntu20-calico-aio jobs are meant as early stages to prevent running the full CI if something is horribly broken
packet_ubuntu20-calico-aio:
# The ubuntu20-calico-all-in-one jobs are meant as early stages to prevent running the full CI if something is horribly broken
packet_ubuntu20-calico-all-in-one:
stage: deploy-part1 stage: deploy-part1
extends: .packet_pr extends: .packet_pr
when: on_success when: on_success
@ -41,22 +41,22 @@ packet_ubuntu20-calico-aio:
# ### PR JOBS PART2 # ### PR JOBS PART2
packet_ubuntu20-aio-docker:
packet_ubuntu20-all-in-one-docker:
stage: deploy-part2 stage: deploy-part2
extends: .packet_pr extends: .packet_pr
when: on_success when: on_success
packet_ubuntu20-calico-aio-hardening:
packet_ubuntu20-calico-all-in-one-hardening:
stage: deploy-part2 stage: deploy-part2
extends: .packet_pr extends: .packet_pr
when: on_success when: on_success
packet_ubuntu22-aio-docker:
packet_ubuntu22-all-in-one-docker:
stage: deploy-part2 stage: deploy-part2
extends: .packet_pr extends: .packet_pr
when: on_success when: on_success
packet_ubuntu22-calico-aio:
packet_ubuntu22-calico-all-in-one:
stage: deploy-part2 stage: deploy-part2
extends: .packet_pr extends: .packet_pr
when: on_success when: on_success
@ -235,7 +235,7 @@ packet_fedora37-calico-swap-selinux:
extends: .packet_pr extends: .packet_pr
when: manual when: manual
packet_amazon-linux-2-aio:
packet_amazon-linux-2-all-in-one:
stage: deploy-part2 stage: deploy-part2
extends: .packet_pr extends: .packet_pr
when: manual when: manual

4
docs/test_cases.md

@ -1,6 +1,6 @@
# Node Layouts # Node Layouts
There are four node layout types: `default`, `separate`, `ha`, and `scale`.
There are five node layout types: `default`, `separate`, `ha`, `scale`, and `all-in-one`.
`default` is a non-HA two nodes setup with one separate `kube_node` `default` is a non-HA two nodes setup with one separate `kube_node`
and the `etcd` group merged with the `kube_control_plane`. and the `etcd` group merged with the `kube_control_plane`.
@ -16,6 +16,8 @@ in the Ansible inventory. This helps test TLS certificate generation at scale
to prevent regressions and profile certain long-running tasks. These nodes are to prevent regressions and profile certain long-running tasks. These nodes are
never actually deployed, but certificates are generated for them. never actually deployed, but certificates are generated for them.
`all-in-one` layout use a single node for with `kube_control_plane`, `etcd` and `kube_node` merged.
Note, the canal network plugin deploys flannel as well plus calico policy controller. Note, the canal network plugin deploys flannel as well plus calico policy controller.
## Test cases ## Test cases

2
tests/cloud_playbooks/create-gce.yml

@ -23,7 +23,7 @@
instance_names: >- instance_names: >-
{%- if mode in ['separate', 'separate-scale', 'ha', 'ha-scale'] -%} {%- if mode in ['separate', 'separate-scale', 'ha', 'ha-scale'] -%}
k8s-{{ test_name }}-1,k8s-{{ test_name }}-2,k8s-{{ test_name }}-3 k8s-{{ test_name }}-1,k8s-{{ test_name }}-2,k8s-{{ test_name }}-3
{%- elif mode == 'aio' -%}
{%- elif mode == 'all-in-one' -%}
k8s-{{ test_name }}-1 k8s-{{ test_name }}-1
{%- else -%} {%- else -%}
k8s-{{ test_name }}-1,k8s-{{ test_name }}-2 k8s-{{ test_name }}-1,k8s-{{ test_name }}-2

2
tests/cloud_playbooks/roles/packet-ci/defaults/main.yml

@ -18,7 +18,7 @@ memory_allocation_ratio: 1
inventory_path: "/tmp/{{ test_name }}/inventory" inventory_path: "/tmp/{{ test_name }}/inventory"
# Deployment mode # Deployment mode
mode: aio
mode: all-in-one
# Cloud init config for each os type # Cloud init config for each os type
# distro: fedora -> I2Nsb3VkLWNvbmZpZwpzeXN0ZW1faW5mbzoKICBkaXN0cm86IGZlZG9yYQp1c2VyczoKIC0gbmFtZToga3ViZXNwcmF5CiAgIGdyb3Vwczogd2hlZWwKICAgc3VkbzogJ0FMTD0oQUxMKSBOT1BBU1NXRDpBTEwnCiAgIHNoZWxsOiAvYmluL2Jhc2gKICAgbG9ja19wYXNzd2Q6IEZhbHNlCiAgIGhvbWU6IC9ob21lL2t1YmVzcHJheQogICBzc2hfYXV0aG9yaXplZF9rZXlzOgogICAgIC0gc3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDYW5UaS9lS3gwK3RIWUpBZURocStzRlMyT2JVUDEvSTY5ZjdpVjNVdGtLbFQyMEpmVzFmNkZlWHQvMDRWZjI3V1FxK05xczZ2R0JxRDlRWFNZdWYrdDAvczdFUExqVGVpOW1lMW1wcXIrdVRlK0tEdFRQMzlwZkQzL2VWQ2FlQjcyNkdQMkZrYUQwRnpwbUViNjZPM05xaHhPUTk2R3gvOVhUdXcvSzNsbGo0T1ZENkdyalIzQjdjNFh0RUJzWmNacHBNSi9vSDFtR3lHW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ci job: {{ ci_job_name }}" - name: "Include custom vars for ci job: {{ ci_job_name }}"
include_vars: "../files/{{ ci_job_name }}.yml" include_vars: "../files/{{ ci_job_name }}.yml"
- name: Set VM count needed for CI test_id
set_fact:
vm_count: "{%- if mode in ['separate', 'separate-scale', 'ha', 'ha-scale', 'ha-recover', 'ha-recover-noquorum'] -%}{{ 3 | int }}{%- elif mode == 'aio' -%}{{ 1 | int }}{%- else -%}{{ 2 | int }}{%- endif -%}"
- name: Cleamup old VMs - name: Cleamup old VMs
import_tasks: cleanup-old-vms.yml import_tasks: cleanup-old-vms.yml

2
tests/cloud_playbooks/roles/packet-ci/templates/inventory.j2

@ -33,7 +33,7 @@ instance-2
[etcd] [etcd]
instance-1 instance-1
{% elif mode == "aio" %}
{% elif mode == "all-in-one" %}
[kube_control_plane] [kube_control_plane]
instance-1 instance-1

12
tests/cloud_playbooks/roles/packet-ci/vars/main.yml

@ -0,0 +1,12 @@
---
_vm_count_dict:
separate: 3
separate-scale: 3
ha: 3
ha-scale: 3
ha-recover: 3
ha-recover-noquorum: 3
all-in-one: 1
default: 2
vm_count: "{{ _vm_count_dict[mode | d('default')] }}"

tests/files/packet_amazon-linux-2-aio.yml → tests/files/packet_amazon-linux-2-all-in-one.yml

@ -1,4 +1,4 @@
--- ---
# Instance settings # Instance settings
cloud_image: amazon-linux-2 cloud_image: amazon-linux-2
mode: aio
mode: all-in-one

tests/files/packet_ubuntu20-aio-docker.yml → tests/files/packet_ubuntu20-all-in-one-docker.yml

@ -1,7 +1,7 @@
--- ---
# Instance settings # Instance settings
cloud_image: ubuntu-2004 cloud_image: ubuntu-2004
mode: aio
mode: all-in-one
# Kubespray settings # Kubespray settings
auto_renew_certificates: true auto_renew_certificates: true

1
tests/files/packet_ubuntu20-calico-aio-ansible-2_11.yml

@ -1 +0,0 @@
packet_ubuntu20-calico-aio.yml

1
tests/files/packet_ubuntu20-calico-all-in-one-ansible-2_11.yml

@ -0,0 +1 @@
packet_ubuntu20-calico-all-in-one.yml

tests/files/packet_ubuntu20-calico-aio-hardening.yml → tests/files/packet_ubuntu20-calico-all-in-one-hardening.yml

@ -1,7 +1,7 @@
--- ---
# Instance settings # Instance settings
cloud_image: ubuntu-2004 cloud_image: ubuntu-2004
mode: aio
mode: all-in-one
# Kubespray settings # Kubespray settings
auto_renew_certificates: true auto_renew_certificates: true

tests/files/packet_ubuntu20-calico-aio.yml → tests/files/packet_ubuntu20-calico-all-in-one.yml

@ -1,7 +1,7 @@
--- ---
# Instance settings # Instance settings
cloud_image: ubuntu-2004 cloud_image: ubuntu-2004
mode: aio
mode: all-in-one
# Kubespray settings # Kubespray settings
auto_renew_certificates: true auto_renew_certificates: true

tests/files/packet_ubuntu22-aio-docker.yml → tests/files/packet_ubuntu22-all-in-one-docker.yml

@ -1,7 +1,7 @@
--- ---
# Instance settings # Instance settings
cloud_image: ubuntu-2204 cloud_image: ubuntu-2204
mode: aio
mode: all-in-one
vm_memory: 1600Mi vm_memory: 1600Mi
# Kubespray settings # Kubespray settings

tests/files/packet_ubuntu22-calico-aio.yml → tests/files/packet_ubuntu22-calico-all-in-one.yml

@ -1,7 +1,7 @@
--- ---
# Instance settings # Instance settings
cloud_image: ubuntu-2204 cloud_image: ubuntu-2204
mode: aio
mode: all-in-one
vm_memory: 1600Mi vm_memory: 1600Mi
# Kubespray settings # Kubespray settings

4
tests/templates/inventory-gce.j2

@ -1,6 +1,6 @@
{% set node1 = gce.instance_data[0].name %} {% set node1 = gce.instance_data[0].name %}
{{node1}} ansible_ssh_host={{gce.instance_data[0].public_ip}} {{node1}} ansible_ssh_host={{gce.instance_data[0].public_ip}}
{% if mode != "aio" %}
{% if mode != "all-in-one" %}
{% set node2 = gce.instance_data[1].name %} {% set node2 = gce.instance_data[1].name %}
{{node2}} ansible_ssh_host={{gce.instance_data[1].public_ip}} {{node2}} ansible_ssh_host={{gce.instance_data[1].public_ip}}
{% endif %} {% endif %}
@ -46,7 +46,7 @@
[etcd] [etcd]
{{node1}} {{node1}}
{% elif mode == "aio" %}
{% elif mode == "all-in-one" %}
[kube_control_plane] [kube_control_plane]
{{node1}} {{node1}}

Loading…
Cancel
Save