Skip to content

Commit

Permalink
update nomad config using attr.unique.network.ip-address
Browse files Browse the repository at this point in the history
  • Loading branch information
star3am committed Jul 29, 2024
1 parent c928ccf commit d0917a6
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions nomad/nomad.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ datacenter = "dc1"
advertise {
# Defaults to the first private IP address.
http = "10.9.99.10"
rpc = "10.9.99.10"
serf = "10.9.99.10:5648" # non-default ports may be specified
http = "${attr.unique.network.ip-address}"
rpc = "${attr.unique.network.ip-address}"
serf = "${attr.unique.network.ip-address}:5648" # non-default ports may be specified
}
server {
Expand All @@ -170,7 +170,7 @@ client {
# If you run previous versions of Nomad you will notice that the fingerprinted capacity is always 1000MHz. This is a value we used to hardcode as a fallback but we dont anymore on 1.7.x (https://github.com/hashicorp/nomad/blob/release/1.6.x/client/fingerprint/cpu.go#L23) because its just wrong.
# The only option for now is to pass their own hardcoded value using client.cpu_total_compute (https://developer.hashicorp.com/nomad/docs/configuration/client#cpu_total_compute)
cpu_total_compute = 8000
servers = ["10.9.99.10:4647"]
servers = ["${attr.unique.network.ip-address}:4647"]
# network_interface = "enp0s8"
# https://www.nomadproject.io/docs/drivers/docker.html#volumes
# https://github.com/hashicorp/nomad/issues/5562
Expand Down Expand Up @@ -202,7 +202,7 @@ telemetry {
}
consul {
address = "10.9.99.10:8500"
address = "${attr.unique.network.ip-address}:8500"
}
EOF
if [ -f /vagrant/nomad/license.hclic ]; then
Expand Down Expand Up @@ -246,19 +246,19 @@ sleep 10
nomad server members
nomad node status

# cd /vagrant/nomad/nomad/jobs;
# echo -e '\e[38;5;198m'"++++ "
# echo -e '\e[38;5;198m'"++++ Start Nomad Fabio job"
# echo -e '\e[38;5;198m'"++++ "
# nomad plan --address=http://localhost:4646 fabio.nomad
# nomad run --address=http://localhost:4646 fabio.nomad
cd /vagrant/nomad/nomad/jobs;
echo -e '\e[38;5;198m'"++++ "
echo -e '\e[38;5;198m'"++++ Start Nomad Fabio job"
echo -e '\e[38;5;198m'"++++ "
nomad plan --address=http://localhost:4646 fabio.nomad
nomad run --address=http://localhost:4646 fabio.nomad
# # curl -v -H 'Host: fabio.service.consul' http://${VAGRANT_IP}:9999/

# echo -e '\e[38;5;198m'"++++ "
# echo -e '\e[38;5;198m'"++++ Start Nomad Traefik job"
# echo -e '\e[38;5;198m'"++++ "
# nomad plan --address=http://localhost:4646 traefik.nomad
# nomad run --address=http://localhost:4646 traefik.nomad
echo -e '\e[38;5;198m'"++++ "
echo -e '\e[38;5;198m'"++++ Start Nomad Traefik job"
echo -e '\e[38;5;198m'"++++ "
nomad plan --address=http://localhost:4646 traefik.nomad
nomad run --address=http://localhost:4646 traefik.nomad
# nomad plan --address=http://localhost:4646 traefik-whoami.nomad
# nomad run --address=http://localhost:4646 traefik-whoami.nomad

Expand Down

0 comments on commit d0917a6

Please sign in to comment.