Commit graph

21512 commits

Author SHA1 Message Date
Ben Buzbee e247f8806b Don't treat a failed recover + successful destroy as a successful
recover

This code just seems incorrect. As it stands today it reports a
successful restore if RecoverTask fails and then DestroyTask succeeds.

This can result in a really annoying bug where it then calls RecoverTask
again, whereby it will probably get ErrTaskNotFound and call DestroyTask
once more.

I think the only reason this has not been noticed so far is because most
drivers like Docker will return Success, then nomad will call
RecoverTask, get an error (not found) and call DestroyTask again, and
get a ErrTasksNotFound err.
2021-07-03 01:46:36 +00:00
Grant Griffiths 7f8e285559
CSI: Snapshot volume create should use vol.Secrets (#10840)
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-07-02 08:28:22 -04:00
Tim Gross db96e40f3a
docker: move host path for hosts file mount to alloc dir (#10823)
In Nomad 1.1.1 we generate a hosts file based on the Nomad-owned network
namespace, rather than using the default hosts file from the pause
container. This hosts file should be shared between tasks in the same
allocation so that tasks can update the file and have the results propagated
between tasks.
2021-06-30 11:10:04 -04:00
James Rasell 762d68a51c
Merge pull request #10829 from hashicorp/gh-10820-docs
changelog: add entry for #10822
2021-06-30 08:37:02 +02:00
James Rasell 9d093e4d8c
Merge pull request #10831 from jcalonso/patch-1
[docs] Fix missing opening quote
2021-06-30 08:36:39 +02:00
Juan Carlos Alonso ea272d91ce
Fix missing opening quote 2021-06-30 12:33:34 +08:00
Seth Hoenig d1fa7ed88c
Merge pull request #10805 from hashicorp/b-cn-tls-env
consul/connect: automatically set consul tls sni name for connect native tasks
2021-06-29 14:10:21 -05:00
James Rasell 0e9955bb4a
Merge pull request #10822 from hashicorp/b-gh-10820
cli: fixed system commands so they correctly use passed flags.
2021-06-29 10:11:00 +02:00
James Rasell ad6580686b
changelog: add entry for #10822 2021-06-29 10:10:32 +02:00
Tim Gross 5e6aca18e4
docs: unset port to field maps to dynamic port (#10828) 2021-06-28 15:55:24 -04:00
Tim Gross 777db36185
docs: add missing backwards compat warning about port_map (#10827)
The `docker` driver's `port_map` field was deprecated in 0.12 and this is
documented in the task driver's docs, but we never explicitly flagged it for
backwards compatibility.
2021-06-28 15:49:41 -04:00
Kendall Strautman 02d63a2024
chore: upgrade react-head and deps (#10811) 2021-06-28 08:55:38 -07:00
Seth Hoenig 5aa657c6bd consul/connect: automatically set consul tls sni name for connect native tasks
This PR makes it so that Nomad will automatically set the CONSUL_TLS_SERVER_NAME
environment variable for Connect native tasks running in bridge networking mode
where Consul has TLS enabled. Because of the use of a unix domain socket for
communicating with Consul when in bridge networking mode, the server name is
a file name instead of something compatible with the mTLS certificate Consul
will authenticate against. "localhost" is by default a compatible name, so Nomad
will set the environment variable to that.

Fixes #10804
2021-06-28 08:36:53 -05:00
Boris Shomodjvarac 64b1cafa57
docs: update csi_plugin example (#10821)
Current efs driver does not support telling it if its a `node` or a `controller`, and it will not print any error it will just ignore all other parameters then:(
So this will result in endpoint being `/tmp/csi.sock` and not `/csi/csi.sock` which will in turn break nomad/csi integration.

Also I changed the latest image tag to v1.3.2 to make sure anybody copy pasting this example is sure that it will work.

Tested on nomad 1.1.2
2021-06-28 08:28:03 -04:00
James Rasell 7a89dfe0cb
cli: fixed system commands so they correctly use passed flags. 2021-06-28 10:57:50 +02:00
Tim Gross 38e83f5ddc
csi: fix CLI panic when formatting volume status with -verbose flag (#10818)
When the `-verbose` flag is passed to the `nomad volume status` command, we
hit a code path where the rows of text to be formatted were not initialized
correctly, resulting in a panic in the CLI.
2021-06-25 16:17:37 -04:00
Zachary Shilton 3d799f9896
website: upgrade code-block (#10792)
* website: upgrade code-block

* website: bump to latest pre-releases

* website: bump to stable releases
2021-06-22 11:55:58 -04:00
Mahmood Ali f595e88563
Merge pull request #10801 from hashicorp/merge-release-1.1.2
Prepare for 1.1.3 development
2021-06-22 10:46:41 -04:00
Mahmood Ali 01049c581d prepare for 1.1.3 development 2021-06-22 10:41:44 -04:00
Mahmood Ali ee12c81fcc
update website to 1.1.2 (#10800) 2021-06-22 10:40:46 -04:00
Tim Gross ad8eb33cd7
docs: improve CSI deployment recommendations (#10798)
* add some more context to the recommendations
* add recommendations around per-AZ `plugin_id`
2021-06-22 10:23:09 -04:00
Nomad Release Bot 317ba8b3a2 remove generated files 2021-06-22 14:13:49 +00:00
Nomad Release Bot fe5f4da30c
Release v1.1.2 2021-06-22 14:12:36 +00:00
Nomad Release bot 82b3f00d6e Generate files for 1.1.2 release 2021-06-22 00:45:27 +00:00
Mahmood Ali 9fb0a8376a prepare changelog for 1.1.2 2021-06-21 20:36:39 -04:00
Dave May 1e51d00d98
Add remaining pprof profiles to nomad operator debug (#10748)
* Add remaining pprof profiles to debug dump
* Refactor pprof profile capture
* Add WaitForFilesUntil and WaitForResultUntil utility functions
* Add CHANGELOG entry
2021-06-21 14:22:49 -04:00
Seth Hoenig 2994870d43
Merge pull request #10795 from hashicorp/docs-update-cl
docs: update cl with missing entries
2021-06-21 09:24:59 -05:00
Seth Hoenig a89eea2ec3 docs: update cl with missing entries 2021-06-21 09:22:48 -05:00
Huan Wang 3da7a4e206
update-gopsutil (#10790) 2021-06-21 10:19:39 -04:00
Seth Hoenig 37b265dc75
Merge pull request #10789 from hashicorp/b-cns-mups
consul/connect: Validate uniqueness of Connect upstreams within task group
2021-06-21 09:01:02 -05:00
Seth Hoenig ebaaaae88e consul/connect: Validate uniqueness of Connect upstreams within task group
This PR adds validation during job submission that Connect proxy upstreams
within a task group are using different listener addresses. Otherwise, a
duplicate envoy listener will be created and not be able to bind.

Closes #7833
2021-06-18 16:50:53 -05:00
Russell Rollins 76446ba512
Adds error handling for client error in getRandomJobAlloc. (#10787) 2021-06-18 16:26:43 -04:00
Seth Hoenig 0f2ffec001
Merge pull request #10784 from hashicorp/b-dlskf
e2e: fix a couple recent e2e bugs
2021-06-18 13:17:20 -05:00
Seth Hoenig 80f4340b77 e2e: use -detach mode when registering jobs with cli
This PR changes the e2e helper thingy to set -detach option
when registering a job with the CLI instead of the API. This is
necessary for jobs which never become healthy, as the deployment
never finishes for failing jobs and the command never returns,
causing the test to timeout after 10 minutes.
2021-06-18 12:18:40 -05:00
Seth Hoenig 0d9208f1a0 consul: set task name only for group service checks
This PR fixes a bug introduced in a refactoring

https://github.com/hashicorp/nomad/pull/10764/files#diff-56b3c82fcbc857f8fb93a903f1610f6e6859b3610a4eddf92bad9ea27fdc85ec

where task level service checks would inherent the task name
field, when they shouldn't.

Fixes #10781
2021-06-18 12:16:27 -05:00
Tim Gross 59c1237fc9
tests: allocrunner CNI tests are Linux-only (#10783)
Running the `client/allocrunner` tests fail to compile on macOS because the
CNI test file depends on the CNI network configurator, which is in a
Linux-only file.
2021-06-18 11:34:31 -04:00
Tim Gross 40a7b24dca
deps: bump go-getter to 1.5.4 (#10778) 2021-06-17 16:30:00 -04:00
Seth Hoenig 5865c87dd0
Merge pull request #10776 from hashicorp/b-cns-sysjob-ups
consul/connect: in-place update service definition when connect upstreams are modified
2021-06-17 10:13:56 -05:00
Tim Gross 74947d6591
docs: host_network does support Docker task port mapping (#10774) 2021-06-17 09:11:10 -04:00
Tim Gross bb7437ab9b
changelog entry for #10756 2021-06-16 22:02:10 -04:00
Seth Hoenig 532b898b07 consul/connect: in-place update service definition when connect upstreams are modified
This PR fixes a bug where modifying the upstreams of a Connect sidecar proxy
would not result Consul applying the changes, unless an additional change to
the job would trigger a task replacement (thus replacing the service definition).

The fix is to check if upstreams have been modified between Nomad's view of the
sidecar service definition, and the service definition for the sidecar that is
actually registered in Consul.

Fixes #8754
2021-06-16 16:48:26 -05:00
Tim Gross 7bd61bbf43
docker: generate /etc/hosts file for bridge network mode (#10766)
When `network.mode = "bridge"`, we create a pause container in Docker with no
networking so that we have a process to hold the network namespace we create
in Nomad. The default `/etc/hosts` file of that pause container is then used
for all the Docker tasks that share that network namespace. Some applications
rely on this file being populated.

This changeset generates a `/etc/hosts` file and bind-mounts it to the
container when Nomad owns the network, so that the container's hostname has an
IP in the file as expected. The hosts file will include the entries added by
the Docker driver's `extra_hosts` field.

In this changeset, only the Docker task driver will take advantage of this
option, as the `exec`/`java` drivers currently copy the host's `/etc/hosts`
file and this can't be changed without breaking backwards compatibility. But
the fields are available in the task driver protobuf for community task
drivers to use if they'd like.
2021-06-16 14:55:22 -04:00
dependabot[bot] 7a5a8ac8c1
build(deps): bump postcss from 7.0.35 to 7.0.36 in /website (#10772)
Bumps [postcss](https://github.com/postcss/postcss) from 7.0.35 to 7.0.36.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/7.0.35...7.0.36)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-16 12:18:43 -04:00
dependabot[bot] 56ba7ab2cc
build(deps): bump ws from 7.3.1 to 7.4.6 in /scripts/screenshots/src (#10671)
Bumps [ws](https://github.com/websockets/ws) from 7.3.1 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.3.1...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-16 11:09:34 -04:00
Seth Hoenig c7826699da
Merge pull request #10765 from hashicorp/b-java-fp-version
client/fingerprint/java: improve java version string regex matching
2021-06-15 17:14:13 -05:00
Seth Hoenig 8f493cfa89 client/fingerprint/java: improve java version string regex matching
This PR improves the regular expression used for matching the java
version string, which varies a lot depending on the java vendor and
version.

These are the example strings we now test for:

java version "1.7.0_80"
openjdk version "11.0.1" 2018-10-16
openjdk version "11.0.1" 2018-10-16
java version "1.6.0_36"
openjdk version "1.8.0_192"
openjdk 11.0.11 2021-04-20 LTS

The last one is a new test added on behalf of #6081, which is
still broken on today's CentOS 7 default JDK package.

openjdk 11.0.11 2021-04-20 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.11+9-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9-LTS, mixed mode, sharing)

==> Evaluation "21c6caf7" finished with status "complete" but failed to place all allocations:
    Task Group "example" (failed to place 1 allocation):
      * Constraint "${driver.java.version} >= 11.0.0": 1 nodes excluded by filter
    Evaluation "2b737d48" waiting for additional capacity to place remainder

Fixes #6081
2021-06-15 14:15:01 -05:00
Seth Hoenig a470b2e3c8
Merge pull request #10764 from hashicorp/b-passfail-lost
consul: make failures_before_critical and success_before_passing work with group services
2021-06-15 12:41:04 -05:00
Seth Hoenig 4e3b543450 docs: add bugfix note to 1.0.8 2021-06-15 12:40:44 -05:00
Seth Hoenig d75669da4a consul: make failures_before_critical and success_before_passing work with group services
This PR fixes some job submission plumbing to make sure the Consul Check parameters
- failure_before_critical
- success_before_passing

work with group-level services. They already work with task-level services.
2021-06-15 11:20:40 -05:00
Seth Hoenig 8a6686251b
Merge pull request #10762 from hashicorp/docs-update-cl-2
docs: update changelog
2021-06-15 09:25:51 -05:00