#9 README: add example bringup commands for EC2
Merged 2 years ago by dustymabe. Opened 2 years ago by dustymabe.
releng/ dustymabe/archive-repo-manager dusty-readme  into  main

file modified
+38 -3
@@ -81,9 +81,44 @@ 

  cat archive-repo-manager.bu | envsubst | butane --pretty > archive-repo-manager.ign

  ```

  

- Then launch the FCOS machine with the `archive-repo-manager.ign`. After

- logging in you can switch to the `worker` user and monitor the systemd user

- units:

+ Then launch the FCOS machine with the `archive-repo-manager.ign`. Here

+ is an example doing that in AWS:

+ 

+ ```

+ # Add your credentials for EC2 to the environment

+ HISTCONTROL='ignoreboth'

+  export AWS_DEFAULT_REGION=us-east-1

+  export AWS_ACCESS_KEY_ID=XXXX

+  export AWS_SECRET_ACCESS_KEY=YYYYYYYY

+ 

+ # Bring the instance up with appropriate details

+ NAME='archive-repo-manager'

+ AMI='ami-0560e1583a204b92b'

+ TYPE='t4g.medium'

+ DISK='20'

+ SUBNET='subnet-0732e4cda7466a2ae'

+ SECURITY_GROUPS='sg-7d0b4c05'

+ USERDATA="${PWD}/archive-repo-manager.ign"

+ aws ec2 run-instances                     \

+     --output json                         \

+     --image-id $AMI                       \

+     --instance-type $TYPE                 \

+     --subnet-id $SUBNET                   \

+     --security-group-ids $SECURITY_GROUPS \

+     --user-data "file://${USERDATA}"      \

+     --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=${NAME}}]" \

+     --block-device-mappings "VirtualName=/dev/xvda,DeviceName=/dev/xvda,Ebs={VolumeSize=${DISK},VolumeType=gp3}" \

+     > out.json

+ 

+ # Get IP and ssh in

+ INSTANCE=$(jq --raw-output .Instances[0].InstanceId out.json)

+ IP=$(aws ec2 describe-instances --instance-ids $INSTANCE --output json \

+      | jq -r '.Reservations[0].Instances[0].PublicIpAddress')

+ ssh "core@${IP}"

+ ```

+ 

+ After logging in you can switch to the `worker` user and monitor the systemd

+ user units:

  

  ```

  sudo machinectl shell worker@

no initial comment

Pull-Request has been merged by dustymabe

2 years ago
Metadata