Commit Graph

15526 Commits

Author SHA1 Message Date
Charlie Voiselle 9f0473d32f
Updated minimum development go version 2019-06-13 09:36:09 -04:00
Danielle Lancashire 8112177503
consul: Include port-label in service registration
It is possible to provide multiple identically named services with
different port assignments in a Nomad configuration.

We introduced a regression when migrating to stable service identifiers where
multiple services with the same name would conflict, and the last definition
would take precedence.

This commit includes the port label in the stable service identifier to
allow the previous behaviour where this was supported, for example
providing:

```hcl
service {
  name = "redis-cache"
  tags = ["global", "cache"]
  port = "db"
  check {
    name     = "alive"
    type     = "tcp"
    interval = "10s"
    timeout  = "2s"
  }
}

service {
  name = "redis-cache"
  tags = ["global", "foo"]
  port = "foo"

  check {
    name     = "alive"
    type     = "tcp"
    port     = "db"
    interval = "10s"
    timeout  = "2s"
  }
}

service {
  name = "redis-cache"
  tags = ["global", "bar"]
  port = "bar"

  check {
    name     = "alive"
    type     = "tcp"
    port     = "db"
    interval = "10s"
    timeout  = "2s"
  }
}
```

in a nomad task definition is now completely valid. Each service
definition with the same name must still have a unique port label however.
2019-06-13 15:24:54 +02:00
Nick Ethier 1b7fa4fe29
Optional Consul service tags for nomad server and agent services (#5706)
Optional Consul service tags for nomad server and agent services
2019-06-13 09:00:35 -04:00
Michael Schurter b2d62096d0 docs: checklists don't support numbered lists
The order didn't really make sense anyway.
2019-06-12 15:35:48 -07:00
Mahmood Ali 1ead8b60d2 update website to link to Nomad 0.9.3 2019-06-12 14:56:18 -04:00
Mahmood Ali e31159bf1f Prepare for 0.9.4 dev cycle 2019-06-12 18:47:50 +00:00
Mahmood Ali 21aa1cdc0e
Release v0.9.3 2019-06-12 18:44:47 +00:00
Nomad Release bot 4803215109 Generate files for 0.9.3 release 2019-06-12 16:11:16 +00:00
Preetha 71ba7eb9cb
Merge pull request #5815 from hashicorp/f-downgrade-docs
Add warning docs around downgrades
2019-06-12 10:39:43 -05:00
Danielle Lancashire 54d544e874
update changelog 2019-06-12 17:35:57 +02:00
Preetha 8a98817fe4
Merge pull request #5820 from hashicorp/r-assorted-changes-20190612_1
Assorted minor changes
2019-06-12 10:33:16 -05:00
Danielle f923b568e0
Merge pull request #5821 from hashicorp/dani/b-5770
trhooks: Add TaskStopHook interface to services
2019-06-12 17:30:49 +02:00
Chris Baker 6d4e840453
Merge pull request #5825 from hashicorp/docs-updated-alloc-examples
documentation: fixed incorrect URLs in allocation signal/restart documentation
2019-06-12 11:28:05 -04:00
Chris Baker ccb9992930 documentation: fixed incorrect URLs in allocation signal/restart documentation 2019-06-12 15:14:34 +00:00
Danielle cc82195d05
Merge pull request #5823 from hashicorp/dani/fix-restart-api
alloc-lifecycle: Fix restart with empty body
2019-06-12 17:07:46 +02:00
Danielle Lancashire c326344b57
trt: Fix test 2019-06-12 17:06:11 +02:00
Danielle 559ccfe797
Merge pull request #5822 from hashicorp/dani/allocrestartapidocs
docs: Add missing docs for alloc restart api
2019-06-12 16:58:59 +02:00
Danielle Lancashire 7fa6d6aad5
update changelog 2019-06-12 16:06:18 +02:00
Danielle Lancashire 13d76e35fd
trhooks: Add TaskStopHook interface to services
We currently only run cleanup Service Hooks when a task is either
Killed, or Exited. However, due to the implementation of a task runner,
tasks are only Exited if they every correctly started running, which is
not true when you recieve an error early in the task start flow, such as
not being able to pull secrets from Vault.

This updates the service hook to also call consul deregistration
routines during a task Stop lifecycle event, to ensure that any
registered checks and services are cleared in such cases.

fixes #5770
2019-06-12 16:00:21 +02:00
Danielle Lancashire ae8bb7365a
alloc-lifecycle: Fix restart with empty body
Currently when you submit a manual request to the alloc lifecycle API
with a version of Curl that will submit empty bodies, the alloc restart
api will fail with an EOF error.

This behaviour is undesired, as it is reasonable to not submit a body at
all when restarting an entire allocation rather than an individual task.

This fixes it by ignoring EOF (not unexpected EOF) errors and treating
them as entire task restarts.
2019-06-12 15:35:00 +02:00
Danielle Lancashire bea23e1eb1
docs: Add missing docs for alloc restart api 2019-06-12 15:09:52 +02:00
Mahmood Ali 07f2c77c44 comment DenormalizeAllocationDiffSlice applies to terminal allocs only 2019-06-12 08:28:43 -04:00
Mahmood Ali b00d1f1e10 tests: parsing dir should be equivalent to parsing individual files 2019-06-12 08:19:09 -04:00
Mahmood Ali 3d8f2622e9 tests: avoid manipulating package variables 2019-06-12 08:16:32 -04:00
Mahmood Ali 2fb8cdd484
Merge pull request #5818 from hashicorp/b-consul-stanza
fix consul stanza parsing when multiple -config arguments are used
2019-06-12 06:29:24 -04:00
Lang Martin 3837c9b021 command add comments re: defaults to LoadConfig 2019-06-11 22:35:43 -04:00
Lang Martin 02aae678be config_parse_test update comment for accuracy 2019-06-11 22:30:20 -04:00
Lang Martin 7aa95ebd6f config_parse get rid of ParseConfigDefault 2019-06-11 22:00:23 -04:00
Lang Martin 9b0411af6a Revert "config explicitly merge defaults once when using a config directory"
This reverts commit 006a9a1d454739eee21b7d8abb8b7aef1353b648.
2019-06-11 22:00:23 -04:00
Mahmood Ali 1fcb1567bc correct GH-5812 changelog 2019-06-11 19:46:50 -04:00
Mahmood Ali 4993252601 changelog GH-5817 2019-06-11 19:44:18 -04:00
Mahmood Ali fbf226bd25
Merge pull request #5817 from hashicorp/b-consul-stanza
fix consul stanza parsing when a configuration directory is used
2019-06-11 19:17:32 -04:00
Lang Martin 1e2f87a11e agent/testdata add a configuration directory for testing 2019-06-11 16:34:04 -04:00
Lang Martin fe8a4781d8 config merge maintains *HCL string fields used for duration conversion 2019-06-11 16:34:04 -04:00
Lang Martin 3bd153690b config_parse_test, handle defaults 2019-06-11 16:34:04 -04:00
Lang Martin c97dd512f4 config explicitly merge defaults once when using a config directory 2019-06-11 15:42:27 -04:00
Lang Martin ad56434472 config_parse split out defaults from ParseConfig 2019-06-11 15:42:27 -04:00
Buck Doyle 93e7f60be5
Change Netlify site id (#5814)
The Netlify site now belongs to the Hashicorp organisation
rather than the hc-nomad user.
2019-06-11 14:25:55 -05:00
Preetha Appan cd813e50ec
Add warning docs around downgrades 2019-06-11 13:16:37 -05:00
Mahmood Ali 6f2bcb8775 scripts: use /dev/null when verifying s3 2019-06-11 13:30:54 -04:00
Mahmood Ali 165a4ea868 update changelog for 0.9.3 2019-06-11 13:25:27 -04:00
Mahmood Ali 79698489dc
Merge pull request #5806 from hashicorp/b-systemd-cgroups-path
drivers/exec: use an independent name=systemd cgroup path
2019-06-11 13:00:44 -04:00
Mahmood Ali 5734c8a648 update comment 2019-06-11 13:00:26 -04:00
Mahmood Ali d16f9df59b
Merge pull request #5812 from hashicorp/fix-allocresources-reference
Fallback to `alloc.TaskResources` for old allocs
2019-06-11 11:33:25 -04:00
Mahmood Ali 2acf30fdd3 Fallback to `alloc.TaskResources` for old allocs
When a client is running against an old server (e.g. running 0.8),
`alloc.AllocatedResources` may be nil, and we need to check the
deprecated `alloc.TaskResources` instead.

Fixes https://github.com/hashicorp/nomad/issues/5810
2019-06-11 10:32:53 -04:00
Lang Martin a476cff2ba
Merge pull request #5802 from hashicorp/b-config-meta-parsing
config meta parsing
2019-06-11 09:12:36 -04:00
Mahmood Ali 3dd9b939e3
Merge pull request #5805 from hashicorp/b-tg-rename-panic
Fix a panic related to updating alloc taskgroups
2019-06-11 08:53:55 -04:00
Mahmood Ali f7608c4cef exec: use an independent name=systemd cgroup path
We aim for containers to be part of a new cgroups hierarchy independent
from nomad agent.  However, we've been setting a relative path as
libcontainer `cfg.Cgroups.Path`, which makes libcontainer concatinate
the executor process cgroup with passed cgroup, as set in [1].

By setting an absolute path, we ensure that all cgroups subsystem
(including `name=systemd` get a dedicated one).  This matches behavior
in Nomad 0.8, and behavior of how Docker and OCI sets CgroupsPath[2]

Fixes #5736

[1] d7edf9b2e4/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/apply_raw.go (L326-L340)
[2] 238f8eaa31/vendor/github.com/containerd/containerd/oci/spec.go (L229)
2019-06-10 22:00:12 -04:00
Mahmood Ali 7a4900aaa4 client/allocrunner: depend on internal task state
Alloc runner already tracks tasks associated with alloc.  Here, we
become defensive by relying on the alloc runner tracked tasks, rather
than depend on server never updating the job unexpectedly.
2019-06-10 18:42:51 -04:00
Mahmood Ali 392f5bac44 Stop updating allocs.Job on stopping or preemption 2019-06-10 18:30:20 -04:00