A set of tools to be used when maintaining ec2-units, clusters, and containers in a given network. These tools will be setup on a client machine and expect the remote machines to have the proper configuration for interaction.
A .ssh folder must exist and contain any needed keys. Some needed keys would be anything for git repo access or ssh access into ec2 units. The folder must also contain a config file. It does not have to contain anything, rather it should not becuase the contents of it are re-written with the network is “switched”.
To do this we we will use the “vhp-setup-admin” program, but first we must create it. A copy of this file will be in the “vn-netowrk-services” repo, in the “helpers” directory.
1) Create file “vhp-setup-admin”
sudo vim /usr/local/bin/vhp-network-admin
2) Paste the contents of the template “vhp-setup-admin” from the repo.
3) Add excecute permissions for (all users)
sudo chmod +x /usr/local/bin/vhp-network-admin
The program is now ready to be run for the initial admin setup. When run, it will accomplish the following.
Create “vhp-image-builder” - It is a simple program, and only needs to be create once.
Setup Docker context
“touch” .ssh/config - create the file in preparation for setup
Create “vhp-bastion” - for ssh remote access to ec2 units
For now we will also need to create another program for use, the “vhp-net-switch”. Soon this will be create through the vhp-setup-admin, but is simple enough to do manually. Use the steps above for creating vhp-setup-admin program.
Used for ssh connection to a ec2 units in a given network. To use you must pass the associated name in the ssh config file.
vhp-bastion <name>
Config names are:
This is used when building the services into docker images. If the build requires ssh for a git pull, the program requires a key (id_ed25519) to be in the users .ssh folder.
The program runs a build on a Dockerfile located in the directory the program was run from, so you must be in the correct folder.
vhp-image-builder <image:tag>
The image names for the vhp services. Image names will not change, but tags may change if needed. arguments without the tag will create a latest (standard).
Used when you want to switch the network you are interacting with. The program goes through the docker context and ssh config, and re builds them to point to a different network. The excpectation is the network swtiching to has the necessary setup for interaction.
sudo vhp-net-switch <network IP>
The IP of the desired network.