Skip to content

Latest commit

 

History

History
132 lines (92 loc) · 3.12 KB

player-guide.md

File metadata and controls

132 lines (92 loc) · 3.12 KB

Getting Started

This document provides details of how to get started using the Simulator CLI.

journey
  section Configure
    Configure Simulator: player
  section Setup
    Create Bucket: player
    Pull Container Image: player
    Build AMIs: player
  section Launch
    Create Infrastructure: player
    List Scenarios: player
    Install Scenario: player
  section Play
    Play Scenario: player
  section Teardown
    Destroy Infrastructure: player
  section Cleanup
    List AMIs: player
    Delete AMIs: player
Loading

Configure

The Simulator CLI is driven from a configuration file config.yaml.

By default, this is created in $HOME/.simulator but this can be changed to an alternative location by setting the SIMULATOR_DIR environment variable.

The minimal configuration required is to set the name of the S3 bucket where the Terraform state will be stored. This can be achieved by running the following command.

simulator config --bucket <name>

If you are running Docker in Rootless mode, you also need to configure the Simulator CLI for this to ensure that the required files can be created when running the later commands.

simulator config --bucket <name> --rootless

Setup

Before setting up the prerequisites, ensure the AWS_REGION environment variable is set:

For Linux and MacOS:

export AWS_REGION=my-aws-region

For Windows:

$env:AWS_REGION = "my-aws-region"

There are three prerequisite steps to perform to setup your local and AWS environment before you can launch the infrastructure and play the scenarios.

  1. Create the S3 bucket to store the Terraform state
  2. Pull the Simulator Container image containing the configuration and tools to manage the infrastructure and scenarios
  3. Create the two AMIs in your AWS account required for the infrastructure

Run the following commands to perform these steps.

simulator bucket create
simulator container pull

simulator ami build bastion
simulator ami build k8s

Launch

The following steps will create the infrastructure, list the available scenarios, and install the selected scenario into the cluster for you to play.

simulator infra create
simulator scenario list

Choose the scenario you want to play, and using the id, install it into the cluster.

simulator scenario install <id>

Play

With the infrastructure provisioned and the scenario installed, it's time to play!

A Player bundle has been created that will allow you SSH directly into the starting point for the selected scenario.

The configuration directory can be found using the following command:

simulator config --print-dir

From this directory, simple SSH to access the scenario.

ssh -F simulator_config bastion

If you need some help, there are walkthroughs in the docs folder.

Teardown

When no longer required, teardown the infrastructure.

simulator infra destroy

Cleanup

When no longer required, find and delete the AMIs in your AWS account

simulator ami list
simulator ami delete <id>