chore(molecule): Update controller instance type (#421)
* chore(molecule): Update controller instance type
* Set instance types properly
* Update the doc and support backwards compatibility
---------
Co-authored-by: okozachenko1203 <okozachenko1203@users.noreply.github.com>
diff --git a/README.md b/README.md
index 9dd20c8..c92faa9 100644
--- a/README.md
+++ b/README.md
@@ -46,8 +46,23 @@
* `ATMOSPHERE_IMAGE`: The name or UUID of the image to be used for deploying the
instances (defaults to `Ubuntu 20.04.3 LTS (x86_64) [2021-10-04]`).
-* `ATMOSPHERE_INSTANCE_TYPE`: The instance type used to deploy all of the
- different instances (defaults to `v3-standard-4`).
+* `ATMOSPHERE_INSTANCE_TYPE`(Deprecated): The instance type used to deploy all of the
+ different instances.(It doesn't have its own default value.)
+ This has been deprecated from v1.4.0. You can configure the instance type per a
+ machine role using `ATMOSPHERE_CONTROLLER_INSTANCE_TYPE`,
+ `ATMOSPHERE_COMPUTE_INSTANCE_TYPE`, and `ATMOSPHERE_STORAGE_INSTANCE_TYPE`
+ variables. For backwards compatibility, if variables specific to the machine roles
+ are not set and `ATMOSPHERE_INSTANCE_TYPE` is set, `ATMOSPHERE_INSTANCE_TYPE` value
+ is used.
+
+* `ATMOSPHERE_CONTROLLER_INSTANCE_TYPE`: The instance type used to deploy controller
+ instances (defaults to `v3-standard-16`).
+
+* `ATMOSPHERE_COMPUTE_INSTANCE_TYPE`: The instance type used to deploy compute
+ instances (defaults to `v3-standard-4`).
+
+* `ATMOSPHERE_STORAGE_INSTANCE_TYPE`: The instance type used to deploy storage
+ instances (defaults to `v3-standard-4`).
* `ATMOSPHERE_NAMESERVERS`: A comma-separated list of nameservers to be used for
the instances (defaults to `1.1.1.1`).
diff --git a/molecule/default/create.yml b/molecule/default/create.yml
index 557e88b..f7e579b 100644
--- a/molecule/default/create.yml
+++ b/molecule/default/create.yml
@@ -28,7 +28,9 @@
stack_name: "{{ lookup('env', 'ATMOSPHERE_STACK_NAME') | default('atmosphere', True) }}"
public_network: "{{ lookup('env', 'ATMOSPHERE_PUBLIC_NETWORK') | default('public', True) }}"
image: "{{ lookup('env', 'ATMOSPHERE_IMAGE') | default('Ubuntu 20.04.3 LTS (x86_64) [2021-10-04]', True) }}"
- instance_type: "{{ lookup('env', 'ATMOSPHERE_INSTANCE_TYPE') | default('v3-standard-4', True) }}"
+ controller_instance_type: "{{ lookup('env', 'ATMOSPHERE_CONTROLLER_INSTANCE_TYPE') | lookup('env', 'ATMOSPHERE_INSTANCE_TYPE') | default('v3-standard-16', True) }}"
+ compute_instance_type: "{{ lookup('env', 'ATMOSPHERE_COMPUTE_INSTANCE_TYPE') | lookup('env', 'ATMOSPHERE_INSTANCE_TYPE') | default('v3-standard-4', True) }}"
+ storage_instance_type: "{{ lookup('env', 'ATMOSPHERE_STORAGE_INSTANCE_TYPE') | lookup('env', 'ATMOSPHERE_INSTANCE_TYPE') | default('v3-standard-4', True) }}"
nameservers: "{{ lookup('env', 'ATMOSPHERE_NAMESERVERS') | default('1.1.1.1', True) }}"
boot_from_volume: "{{ lookup('env', 'ATMOSPHERE_BOOT_FROM_VOLUME') | bool }}"
create_bastion_host: "{{ lookup('env', 'ATMOSPHERE_CREATE_BASTION_HOST') | bool }}"
@@ -40,7 +42,9 @@
parameters:
public_network: "{{ public_network }}"
image: "{{ image }}"
- instance_type: "{{ instance_type }}"
+ controller_instance_type: "{{ controller_instance_type }}"
+ compute_instance_type: "{{ compute_instance_type }}"
+ storage_instance_type: "{{ storage_instance_type }}"
nameservers: "{{ nameservers }}"
boot_from_volume: "{{ boot_from_volume }}"
create_bastion_host: "{{ create_bastion_host }}"
diff --git a/molecule/default/heat/stack.yaml b/molecule/default/heat/stack.yaml
index cfdfde9..01b57fd 100644
--- a/molecule/default/heat/stack.yaml
+++ b/molecule/default/heat/stack.yaml
@@ -48,7 +48,23 @@
type: boolean
default: false
- instance_type:
+ bastion_instance_type:
+ default: v3-standard-4
+ type: string
+ constraints:
+ - custom_constraint: nova.flavor
+
+ controller_instance_type:
+ type: string
+ constraints:
+ - custom_constraint: nova.flavor
+
+ compute_instance_type:
+ type: string
+ constraints:
+ - custom_constraint: nova.flavor
+
+ storage_instance_type:
type: string
constraints:
- custom_constraint: nova.flavor
@@ -129,7 +145,7 @@
name: bastion
index: -1
image: { get_param: image }
- instance_type: { get_param: instance_type }
+ instance_type: { get_param: bastion_instance_type }
key_name: { get_resource: key_pair }
internal_network: { get_resource: internal_network }
public_network: { get_param: public_network }
@@ -149,7 +165,7 @@
name: ctl
index: "%index%"
image: { get_param: image }
- instance_type: { get_param: instance_type }
+ instance_type: { get_param: controller_instance_type }
key_name: { get_resource: key_pair }
internal_network: { get_resource: internal_network }
public_network: { get_param: public_network }
@@ -169,7 +185,7 @@
name: nvme
index: "%index%"
image: { get_param: image }
- instance_type: { get_param: instance_type }
+ instance_type: { get_param: storage_instance_type }
key_name: { get_resource: key_pair }
internal_network: { get_resource: internal_network }
public_network: { get_param: public_network }
@@ -191,7 +207,7 @@
name: kvm
index: "%index%"
image: { get_param: image }
- instance_type: { get_param: instance_type }
+ instance_type: { get_param: compute_instance_type }
key_name: { get_resource: key_pair }
internal_network: { get_resource: internal_network }
public_network: { get_param: public_network }