This set of Templates provide all the components to deploy a single Gerrit master and a single Gerrit slave in ECS
Four templates are provided in this example:
cf-cluster: define the ECS cluster and the networking stackcf-service-master: define the service stack running Gerrit mastercf-service-slave: define the service stack running Gerrit slavecf-dns-route: define the DNS routing for the serviceerror_log is exported in a Log Group in CloudWatchFollow the steps described in the Prerequisites section
Please refer to the configuration docs to understand how to set up the configuration and what common configuration values are needed. On top of that, you might set the additional parameters, specific for this recipe.
Configuration values affecting deployment environment and cluster properties
SERVICE_MASTER_STACK_NAME: Optional. Name of the master service stack. gerrit-service-master by default.SERVICE_SLAVE_STACK_NAME: Optional. Name of the slave service stack. gerrit-service-slave by default.MASTER_SUBDOMAIN: Optional. Name of the master sub domain. gerrit-master-demo by default.SLAVE_SUBDOMAIN: Optional. Name of the slave sub domain. gerrit-slave-demo by default.CLUSTER_DESIRED_CAPACITY: Optional. Number of EC2 instances composing the cluster. 1 by default.NOTE: if you are planning to run the monitoring stack, set the CLUSTER_DESIRED_CAPACITY value to at least 2. The resources provided by a single EC2 instance won't be enough for all the services that will be ran*
PROMETHEUS_SUBDOMAIN: Optional. Prometheus subdomain. For example: <AWS_PREFIX>-prometheusGRAFANA_SUBDOMAIN: Optional. Grafana subdomain. For example: <AWS_PREFIX>-grafanamake [AWS_REGION=a-valid-aws-region] [AWS_PREFIX=some-cluster-prefix] create-all
The optional AWS_REGION and AWS_REFIX allow you to define where it will be deployed and what it will be named.
It might take several minutes to build the stack. You can monitor the creations of the stacks in CloudFormation
pem file on the current directory. To use when ssh-ing into your instances as follow: ssh -i cluster-keys.pem ec2-user@<ec2_instance_ip>make [AWS_REGION=a-valid-aws-region] [AWS_PREFIX=some-cluster-prefix] delete-all
The optional AWS_REGION and AWS_REFIX allow you to specify exactly which stack you target for deletion.
Note that this will not delete:
Get the URL of your Gerrit master instance this way:
aws cloudformation describe-stacks \ --stack-name <SERVICE_MASTER_STACK_NAME> \ | grep -A1 '"OutputKey": "CanonicalWebUrl"' \ | grep OutputValue \ | cut -d'"' -f 4
Similarly for the slave:
aws cloudformation describe-stacks \ --stack-name <SERVICE_SLAVE_STACK_NAME> \ | grep -A1 '"OutputKey": "CanonicalWebUrl"' \ | grep OutputValue \ | cut -d'"' -f 4
Gerrit master instance ports:
808029418Gerrit slave instance ports:
908039418If you want to monitor your system, you can add a Prometheus and Grafana stack. Here you can find the details on how to add it.
Refer to the Docker section for information on how to setup docker or how to publish images