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
Each recipe provides a setup.env.template
file which is a template for configuring the Gerrit stacks. Copy that into a setup.env
and set the correct values for the provided environment variables.
cp setup.env.template setup.env
This is the list of available parameters:
Configuration values affecting deployment environment and cluster properties
DOCKER_REGISTRY_URI
: Mandatory. URI of the Docker registry. See the prerequisites section for more details.SSL_CERTIFICATE_ARN
: Mandatory. ARN of the SSL Certificate.CLUSTER_STACK_NAME
: Optional. Name of the cluster stack. gerrit-cluster
by default.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.DNS_ROUTING_STACK_NAME
: Optional. Name of the DNS routing stack. gerrit-dns-routing
by default.HOSTED_ZONE_NAME
: Optional. Name of the hosted zone. mycompany.com
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.GERRIT_KEY_PREFIX
: Optional. Secrets prefix used during the Import into AWS Secret Manager. gerrit_secret
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*
Configuration values to spec up Gerrit containers.
GERRIT_RAM
: RAM allocated (MiB) to the Gerrit container. 70000
by default.GERRIT_CPU
: vCPU units allocated to the Gerrit container. 10240
by default.GERRIT_HEAP_LIMIT
: Maximum heap size of the Java process running Gerrit, in bytes. See Gerrit documentation 35g
by default.JGIT_CACHE_SIZE
: Maximum number of bytes to load and cache in memory from pack files. See Gerrit documentation for more details. 12g
by default.Configuration values related to LDAP integration. See more details here
LDAP_SERVER
: Mandatory. URL of the organization’s LDAP server to query for user information and group membership from See Gerrit documentationLDAP_USERNAME
: Mandatory. Username to bind to the LDAP server with See Gerrit documentationLDAP_ACCOUNT_BASE
: Mandatory. Root of the tree containing all user accounts See Gerrit documentationLDAP_GROUP_BASE
: Mandatory. Root of the tree containing all group objects See Gerrit documentationConfiguration values related to SMTP integration. See more details here
SMTP_SERVER
: Mandatory. Hostname (or IP address) of a SMTP server that will relay messages generated by Gerrit to end users See Gerrit documentationSMTP_USER
: Mandatory. User name to authenticate with See Gerrit documentationSMTP_DOMAIN
: Mandatory. Domain to be used in the “From” field of any generated email messages See Gerrit documentationmake create-all
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 delete-all
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:
8080
29418
Gerrit slave instance ports:
9080
39418
If 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