Making use of terraform and nomad to setup a cluster orchestration system. This respository will provide an extended example from the main nomad terraform module
The COS (Cluster Orchestration System) consists of three core components.
The nomad instances are organized in so called data-centers. A data-center is a group of nomad instances. A data-center can be specified as destination of a deployment of a nomad job.
The COS organizes it's nodes in five different data-centers.
The data-centers of the COS are organized/ live in three different subnets.
This Cluster Orchestration System allows to pull docker images from public docker registries like Docker Hub and from AWS ECR.
Regarding AWS ECR, it is only possible to pull from the registry of the AWS account and region where this COS is deployed to. Thus you have to create an ECR in the same region on the same account and push your docker images there.
The consul-servers as well as the nomad-servers are build up in an high-availability set up. At least three consul- and nomad-servers are deployed in different availability-zones. The nomad-clients are deployed in three different AZ's as well.
Providing detailed documentation for this module.
Provides example instanziation of this module. The root-example builds up a full working nomad-cluster including the underlying networking, the nomad servers and -clients and a consul cluster for service discovery.
Terraform modules for separate aspects of the cluster orchestration system.
The picture shows the dependencies within the modules of the cos-stack and the dependencies to the networking-stack.
nomad monitor -log-level error|warn|info|debug|trace -node-id <node_id> | -server-id <server_id>
If you have deployed the cluster with https endpoints for the ui-albs and have created a selfsigned certificate you might get errors from the nomad cli complanig about an invalid certificate (x509: certificate is..
). To fix this you have to integrate your custom root-CA you used for signing your certificate apropriately into your system.
Therefore you have to store the PEM encoded CA cert-file locally and give the information where to find it to nomad.
There are two options:
-ca-cert=<path>
flag or NOMAD_CACERT
environment variable-ca-path=<path>
flag or NOMAD_CAPATH
environment variableTo overcome certificate verification issues you can also (not recommended) temporarily skip the certificate verification when using the nomad CLI.
-tls-skip-verify
As additional parameter in your cli calls.
i.e. nomad plan -tls-skip-verify jobfile.nomad
NOMAD_SKIP_VERIFY
Just set the environment variable to 1.
export NOMAD_SKIP_VERIFY=1
And then call your CLI commands as usual.
i.e. nomad plan jobfile.nomad