This repository builds a helper script and image to make it easy to create OCP-4 clusters using agnosticd.
The image is built and available on Quay.io
quay.io/osevg/agnosticd-runnerIt's as easy as:
docker run -it --rm \
-v $(pwd)/config:/opt/app-root/data \
-v $(pwd)/ssh:/opt/app-root/src/.ssh \
quay.io/osevg/agnosticd-runner createNOTE: You'll need to mount as volumes to the container the configuration and ssh keys.
And to run the image you'll need 3 things:
- An AWS account properly set-up
- The configuration to be applied
- A EC2 ssh key-pair to be used
Following is a guide on how to get the 3 things done:
Create an AWS account and use that (root account), or create a user in AWS and give it enough permissions to provision using agnosticD. See agnosticd docs.
You also need a Route53 Hosted Zone and an EC2 ssh key-pair as documented here
The EC2 ssh key will need to be mounted into the container in the /opt/app-root/src/.ssh folder, as documented above. The name of the key is specified as a configuration parameter key_name.
To create the configuration you can run the agnosticd-runner script or image and use the following subcommands:
agnosticd-runner create-envThis will create a file named my_environment-variables.yml that you should edit/tweak to your own needs.
NOTE: At the end of this configuration file you'll need to provide your OCP token from try.openshift.com
NOTE: The EC2 ssh key needs to be in the region you'll use. Follow the doc on how to add the key on all the regions you want.
And to create the AWS credentials sample secret:
agnosticd-runner create-secretThis will not create a file, but will show you the format the file should need. You need to get this information from the AWS console.
Build the container:
docker build -t "quay.io/osevg/agnosticd-runner" .Test the container:
docker run -it --rm \
-v $(pwd)/config:/opt/app-root/data \
-v $(pwd)/ssh:/opt/app-root/src/.ssh \
--entrypoint bash \
quay.io/osevg/agnosticd-runnerTo create a cluster:
agnostic-runner createTo destroy the cluster:
agnostic-runner destroyFor all the options you can just do:
agnostic-runner help