mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-16 18:50:08 -03:30
Add synthetic scale deployment mode
New deploy modes: scale, ha-scale, separate-scale Creates 200 fake hosts for deployment with fake hostvars. Useful for testing certificate generation and propagation to other master nodes. Updated test cases descriptions.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
- set_fact:
|
||||
instance_names: >-
|
||||
{%- if mode in ['separate', 'ha'] -%}
|
||||
{%- if mode in ['separate', 'separate-scale', 'ha', 'ha-scale'] -%}
|
||||
k8s-{{test_name}}-1,k8s-{{test_name}}-2,k8s-{{test_name}}-3
|
||||
{%- else -%}
|
||||
k8s-{{test_name}}-1,k8s-{{test_name}}-2
|
||||
@@ -39,6 +39,18 @@
|
||||
src: ../templates/inventory-gce.j2
|
||||
dest: "{{ inventory_path }}"
|
||||
|
||||
- name: Make group_vars directory
|
||||
file:
|
||||
path: "{{ inventory_path|dirname }}/group_vars"
|
||||
state: directory
|
||||
when: mode in ['scale', 'separate-scale', 'ha-scale']
|
||||
|
||||
- name: Template fake hosts group vars
|
||||
template:
|
||||
src: ../templates/fake_hosts.yml.j2
|
||||
dest: "{{ inventory_path|dirname }}/group_vars/fake_hosts.yml"
|
||||
when: mode in ['scale', 'separate-scale', 'ha-scale']
|
||||
|
||||
- name: Wait for SSH to come up
|
||||
wait_for: host={{item.public_ip}} port=22 delay=10 timeout=180 state=started
|
||||
with_items: "{{gce.instance_data}}"
|
||||
|
||||
3
tests/templates/fake_hosts.yml.j2
Normal file
3
tests/templates/fake_hosts.yml.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
ansible_default_ipv4:
|
||||
address: 255.255.255.255
|
||||
ansible_hostname: "{{ '{{' }}inventory_hostname}}"
|
||||
@@ -2,12 +2,11 @@
|
||||
{% set node2 = gce.instance_data[1].name %}
|
||||
{{node1}} ansible_ssh_host={{gce.instance_data[0].public_ip}}
|
||||
{{node2}} ansible_ssh_host={{gce.instance_data[1].public_ip}}
|
||||
{% if mode is defined and mode in ["separate", "ha"] %}
|
||||
{% if mode is defined and mode in ["separate", "separate-scale"] %}
|
||||
{% set node3 = gce.instance_data[2].name %}
|
||||
{{node3}} ansible_ssh_host={{gce.instance_data[2].public_ip}}
|
||||
{% endif %}
|
||||
|
||||
{% if mode is defined and mode == "separate" %}
|
||||
{% if mode is defined and mode in ["separate", "separate-scale"] %}
|
||||
[kube-master]
|
||||
{{node1}}
|
||||
|
||||
@@ -19,7 +18,7 @@
|
||||
|
||||
[vault]
|
||||
{{node3}}
|
||||
{% elif mode is defined and mode == "ha" %}
|
||||
{% elif mode is defined and mode in ["ha", "ha-scale"] %}
|
||||
[kube-master]
|
||||
{{node1}}
|
||||
{{node2}}
|
||||
@@ -51,3 +50,12 @@
|
||||
[k8s-cluster:children]
|
||||
kube-node
|
||||
kube-master
|
||||
|
||||
{% if mode is defined and mode in ["scale", "separate-scale", "ha-scale"] %}
|
||||
[fake_hosts]
|
||||
fake_scale_host[1:200]
|
||||
|
||||
[kube-node:children]
|
||||
fake_hosts
|
||||
{% endif %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user