Skip to content

Latest commit

 

History

History

conan

Conan The Destroyer (of sandboxes)

This tool cleans up sandboxes.

Conan the destroyer of Sandboxes

It watches the pool of sandboxes, and look for those marked as to_cleanup.

Then it runs aws-nuke to wipe them, and put them back in the pool of available sandboxes.

Dependencies

Install

  1. login as opentlc-mgr user

  2. Clone the Red Hat Demo Platform sandbox repo

    cd
    mkdir pool_management
    cd pool_management
    git clone https://github.com/rhpds/sandbox.git
  3. Install the aws credentials

    ~/.aws/credentials
    [pool-manager]
    aws_access_key_id=...
    aws_secret_access_key=...
  4. Make sure the keytab ~/secrets/hostadmin.keytab exists. It is the key used in the infra-aws-sandbox role to authenticate to IPA.

  5. Install the systemd Unit conan.service

  6. Start and enable the service

    systemctl start conan
    systemctl enable conan

Run as a container

Using podman
# Create the AWS secret

$ cat | podman secret create aws_credentials -
[pool-manager]
aws_access_key_id=...
aws_secret_access_key=...
[pool-manager-dev]
aws_access_key_id=...
aws_secret_access_key=...
[CTRL+D]

# Create the Vault secret

$ cat | podman secret create vault_file -
<PASTE CONTENT OF VAULT SECRET>
[CTRL+D]

$ podman run \
    --init \
    --secret vault_file \
    --secret aws_credentials \
    -e dynamodb_profile=pool-manager-dev \
    -e dynamodb_table=accounts-dev \
    -e dynamodb_region=us-east-1 \
    -e aws_profile=pool-manager \
    -e conan_instance=container$$ \
    -e AWS_SHARED_CREDENTIALS_FILE=/run/secrets/aws_credentials \
    -e vault_file=/run/secrets/vault_file \
    -e ddns_server="..." \
    -e ddns_key_name="..." \
    -e ddns_key_secret="...." \
    -e workdir=/home/opentlc-mgr/pool_management \
    -e AWSCLI=aws \
    -e threads=1 \
    -e NOVENV=true \
    -v $PWD:/home/opentlc-mgr/pool_management/sandbox \
    quay.io/rhpds/sandbox-conan:latest

# For fast iterations on a specific sandbox, you can pass a pattern

podman run -e sandbox_filter="^sandbox2345 " ...

# Delete the secrets when done

$ podman secret rm vault_file aws_credentials

Install via helm

helm install  -f .dev.conan.yaml sandbox-conan deploy/helm-conan/