Command that manages Athena nodes.

Usage

athena-nodes [OPTIONS] COMMAND [ARGS]...
Option Description
-h, –help Show built-in help documentation.
-v, –verbose Enable verbose output.

Commands

Create

Create a node.

athena-nodes create [OPTIONS] <node_type>
Option Description
–avail-zone [A,B,C] Availability zone.
-d, –disk Disk size (in GB) for data disk.
–disk-iops Disk IOPs for data disk.
–disk-type Disk type for data disk.
–groups Comma separated list of instance groups.
–instance-count Number of instances to create.
–instance-image AMI image id.
–instance-size Instance size (t2.micro, c4.large,etc).
–ip-tags Comma separated list of ip tags for multi IP instances.
-r, –refresh-status / –no-refresh-status Refresh node status.
–security-group Security group name.
–service-types Comma separated list of instance types.
–subnet Subnet name.
Arguments
  • <node_type> - Node type (e.g. Backoffice).

Destroy

Destroy nodes.

athena-nodes destroy [OPTIONS] <node_names>
Option Description
-b, –bootstrap Leave bastion nodes running.
-r, –refresh-status / –no-refresh-status refresh node status
Arguments
  • <node_names> - Node names (e.g. backofficea-073-test-dev,internala-230-test-dev).

List

List nodes.

athena-nodes list [OPTIONS]
Option Description
–columns Comma separated list of columns to exclude from a list.
–exclude Comma separated list of columns to exclude from a list.
–show-allocation Show node service allocation.
–show-header / -n Show header.
-s, –show-services Show node services.
–show-table / –names-only Show table.
-u, –show-usage Show node usage.

Modify

Modify nodes.

athena-nodes modify [OPTIONS] <node_names>
Option Description
-d, –disk Disk size (in GB) for data disk.
–disk-device Disk device name (by default /dev/xvdf).
–disk-device-mangle Destroy disk device.
–disk-encrypted / –disk-not-encrypted Should disk contents be encrypted.
–disk-iops Disk IOPs for data disk.
–disk-type Disk type for data disk.
–groups Comma separated list of instance groups.
-s, –instance-size Instance size (t2.micro, c4.large,etc).
–ip-tags Comma separated list of ip tags for multi IP instances.
-r, –refresh-status / –no-refresh-status Refresh node status.
Arguments
  • <node_names> - Node names (e.g. backofficea-073-test-dev,internala-230-test-dev).

Refresh

Refresh node status from consul and AWS.

athena-nodes refresh [OPTIONS] <node_names>
Option Description
–cleanup Remove nodes that are not found in infrastructure.
-f, –fields Comma separated list of fields to update.
Arguments
  • <node_names> - Node names (e.g. backofficea-073-test-dev,internala-230-test-dev).

Start

Start nodes.

athena-nodes start [OPTIONS] <node_names>

| Option | Description | | ————— |:——————–:| | -b, –bootstrap | Start Bastion nodes. | | -r, –refresh-status / –no-refresh-status | Refresh node status. |

Arguments
  • <node_names> - Node names (e.g. backofficea-073-test-dev,internala-230-test-dev).

Stop

Stop nodes.

athena-nodes stop [OPTIONS] <node_names>

| Option | Description | | ————— |:——————–:| | -b, –bootstrap | Leave Bastion nodes running. | | -r, –refresh-status / –no-refresh-status | Refresh node status. |

Arguments
  • <node_names> - Node names (e.g. backofficea-073-test-dev,internala-230-test-dev).

Extending

To modify nodes operations edit nodes-create.yml, nodes-destroy.yml, nodes-modify.yml, nodes-refresh.yml, nodes-start.yml, nodes-stop.yml in environment playbook directory.

Examples

To create a node (Backoffice):

athena-nodes create Backoffice

To create two similar nodes (Backoffice), with groups ‘SYS’, ‘CRM’, and ‘ADMIN’:

athena-nodes create --groups SYS,CRM,ADMIN --instance-count 2 Backoffice

To create a node (Public) of size ‘t2.micro’, with 25GB of disk space and disk type ‘oi1’:

athena-nodes create --instance-size t2.micro --disk 25 --disk-type oi1 Public

To destroy all nodes:

athena-nodes destroy

To destroy a node (backofficea-073-test-dev):

athena-nodes destroy backofficea-073-test-dev

To destroy all nodes except Bastion, and do not refresh node status:

athena-nodes destroy --bootstrap --no-refresh-status

To list all nodes:

athena-nodes list

To list all nodes, their resource usage and allocation:

athena-nodes list --show-usage --show-allocation

To list all nodes and their services, and show only ‘PrivateIP’ and ‘Status’ as additional node columns:

athena-nodes list --show-services -columns PrivateIP,Status

To modify disk size of node ‘backofficea-073-test-dev’ (to 15 GB):

athena-nodes modify --disk 15 backofficea-073-test-dev

To modify size of the node ‘backofficea-073-test-dev’ to ‘c4.large’:

athena-nodes modify --instance-size c4.large backofficea-073-test-dev

To refresh node status from Consul and AWS.

athena-nodes refresh

To refresh node status from Consul and AWS and remove nodes not found in infrastructure.

athena-nodes refresh --cleanup

To refresh node status from Consul and AWS, but update only fields ‘CPU’, ‘Disk’, ‘RAM’, and ‘Size’.

athena-nodes refresh --fields CPU,Disk,RAM,Size

To start all nodes:

athena-nodes start

To start all Bastion nodes:

athena-nodes start --bootstrap

To start a specific node (backofficea-073-test-dev):

athena-nodes start backofficea-073-test-dev

To stop all nodes:

athena-nodes stop

To stop all except Bastion nodes:

athena-nodes stop --bootstrap

To stop a specific node (backofficea-073-test-dev):

athena-nodes stop backofficea-073-test-dev