Nomad
Hello World
@hashicorp
This deploys a simple applicaton as a service with an optional associated consul service.
- Official
- Pack
Updated 2 years ago
- GitHub(opens in new tab)
Hello World
This pack is a simple Nomad job that runs as a service and can be accessed via HTTP.
Changing the Message
To change the message this server responds with, change the "message" variable when running the pack.
nomad-pack run hello_world --var message="Hola Mundo!"
This tells Nomad Pack to tweak the MESSAGE
environment variable that the service reads from.
Consul Service and Load Balancer Integration
Optionally, it can configure a Consul service.
If the register_consul_service
is unset or set to true, the Consul service will be registered.
Several load balancers in the The Nomad Pack Community Registry are configured to connect to this service by default.
The NginX and HAProxy packs are configured to balance the Consul service "hello-world-service", which is th default value for the "consul_service_name" variable.
The Fabio and Traefik packs are configured to search for Consul services with the tags found in the default value of the "consul_service_tags" variable.
Variables
message
(string) - The message your application will respond withcount
(number) - The number of app instances to deployjob_name
(string) - The name to use as the job name which overrides using the pack namedatacenters
(list of strings) - A list of datacenters in the region which are eligible for task placementregion
(string) - The region where jobs will be deployedregister_consul_service
(bool) - If you want to register a consul service for the jobconsul_service_tags
(list of string) - The consul service name for the hello-world applicationconsul_service_name
(string) - The consul service name for the hello-world application