Commit Graph

17519 Commits

Author SHA1 Message Date
Lang Martin
5485cff30b csi: return an empty result list from plugins & volumes without type, not an error (#7471) 2020-03-24 14:28:28 -04:00
Drew Bailey
f8eac80336 Merge pull request #7429 from hashicorp/docs-audit-logging
docs: audit logging
2020-03-24 14:24:31 -04:00
Drew Bailey
d6a7fae70e enterprise index page update 2020-03-24 14:22:37 -04:00
Tim Gross
915fec80a8 CSI: HTTP API docs (#7435)
HTTP API documentation for the `/plugin` and `/volume` endpoints, to
support CSI.
2020-03-24 14:21:45 -04:00
Drew Bailey
09e0841f7b Audit logging documentation
docs for audit logging

enterprise only note

enterprise page audit blurb

add audit to sidebar

add general options audit info

fix name for docs-navigation

link to docs

more docs

add audit log entry examples

fix audit link

clean up audit log docs
2020-03-24 14:20:27 -04:00
Tim Gross
9edba971f5 csi: remove client from plugin on client node update (#7462)
Plugins track the client nodes where they are placed. On client
updates, remove the client from the plugin tracking if the client is
no longer running an instance of that controller/node plugin.

Extends the state store tests to ensure deregistration works as
expected and that controllers and nodes are being tracked
independently.
2020-03-24 13:26:31 -04:00
Chris Baker
33360be3cf Merge pull request #7409 from hashicorp/scaling-api
Scaling API changes
2020-03-24 11:02:09 -05:00
Tim Gross
0e3c33110a Documentation for CSI command line and jobspec (#7439)
Includes:

* changes `nomad alloc status` and `nomad node status`
* changes to `volume` block in jobspec
* new `csi_plugin` block in jobspec
* new `nomad volume register/deregister/status` commands
* new `nomad plugin status` command
2020-03-24 11:09:46 -04:00
Chris Baker
4330fe8497 bad conversion between api.ScalingPolicy and structs.ScalingPolicy meant
that we were throwing away .Min if provided
2020-03-24 14:39:06 +00:00
Chris Baker
e831ec3bd5 added new int64ToPtr method to api/util to avoid pulling in other packages 2020-03-24 14:39:05 +00:00
Chris Baker
ff652bff03 add acl validation to Scaling.ListPolicies and Scaling.GetPolicy 2020-03-24 14:39:05 +00:00
Chris Baker
d4f967cdd4 made count optional during job scaling actions
added ACL protection in Job.Scale
in Job.Scale, only perform a Job.Register if the Count was non-nil
2020-03-24 14:39:05 +00:00
Chris Baker
ac5a166ca3 wip: ACL checking for RPC Job.ScaleStatus 2020-03-24 14:39:05 +00:00
Chris Baker
f704a49962 added new ACL capabilities related to autoscaling:
- read-job-scaling
- scale-job
- list-scaling-policies
- read-scaling-policy

updated the read and right policy dispositions, added the new autoscaler disposition
2020-03-24 14:38:58 +00:00
Lang Martin
e3a3c332a6 csi: volume deregister fails for volumes actively in use (#7445)
* nomad/structs/csi: add InUse to CSIVolume

* nomad/state/state_store: block volume deregistration for in use vols
2020-03-24 10:10:44 -04:00
Tim Gross
d2ae84bd53 Merge pull request #7450 from hashicorp/b-csi-plugin-health-counts
csi: fix missing health count from volume list stub
2020-03-24 10:07:07 -04:00
Chris Baker
9292e88f2b changes to Canonicalize, Validate, and api->struct conversion so that tg.Count, tg.Scaling.Min/Max are well-defined with reasonable defaults.
- tg.Count defaults to tg.Scaling.Min if present (falls back on previous default of 1 if Scaling is absent)
- Validate() enforces tg.Scaling.Min <= tg.Count <= tg.Scaling.Max

modification in ApiScalingPolicyToStructs, api.TaskGroup.Validate so that defaults are handled for TaskGroup.Count and
2020-03-24 13:57:17 +00:00
Chris Baker
41560096d0 scaling api: put api.* objects in agreement with structs.* objects 2020-03-24 13:57:16 +00:00
Chris Baker
2d88d57e52 fixed http endpoints for job.register and job.scalestatus 2020-03-24 13:57:16 +00:00
Chris Baker
4759bc3110 finished Job.ScaleStatus RPC, need to work on http endpoint 2020-03-24 13:57:16 +00:00
Chris Baker
03eb96aba2 wip: scaling status return, almost done 2020-03-24 13:57:15 +00:00
James Rasell
9243718899 scaling: ensure min and max int64s are in toplevel of block. 2020-03-24 13:57:15 +00:00
Chris Baker
66bf8dd48d wip: some tests still failing
updating job scaling endpoints to match RFC, cleaning up the API object as well
2020-03-24 13:57:14 +00:00
Chris Baker
3b4a1aecd9 finished refactoring state store, schema, etc 2020-03-24 13:57:14 +00:00
Chris Baker
c095f41111 wip: removed some commented junk from scaling poc 2020-03-24 13:57:13 +00:00
Luiz Aoqui
9756c64a61 wip: use testify in job scaling tests 2020-03-24 13:57:13 +00:00
Luiz Aoqui
836acc11bd wip: add tests for job scale method 2020-03-24 13:57:12 +00:00
Luiz Aoqui
7544aaac65 wip: add scaling policies methods to the client 2020-03-24 13:57:12 +00:00
Chris Baker
6b9c0043e4 wip: added Enabled to ScalingPolicyListStub, removed JobID from body of scaling request 2020-03-24 13:57:12 +00:00
Chris Baker
16472c026a wip: remove PolicyOverride from scaling request 2020-03-24 13:57:11 +00:00
Chris Baker
94381c0da8 wip: added tests for client methods around group scaling 2020-03-24 13:57:11 +00:00
Chris Baker
4406668b53 wip: add GET endpoint for job group scaling target 2020-03-24 13:57:10 +00:00
Luiz Aoqui
ef7cb0e098 wip: add job scale endpoint in client 2020-03-24 13:57:10 +00:00
Chris Baker
1c9bac9087 wip: added job.scale rpc endpoint, needs explicit test (tested via http now) 2020-03-24 13:57:09 +00:00
Chris Baker
8102849683 wip: working on job group scaling endpoint 2020-03-24 13:55:20 +00:00
Chris Baker
a715eb7820 wip: added policy get endpoint, added UUID to policy 2020-03-24 13:55:20 +00:00
Chris Baker
7ba9b94018 wip: test for scaling policy parsing 2020-03-24 13:55:19 +00:00
Chris Baker
e6d75cab9f wip: was incorrectly parsing ScalingPolicy 2020-03-24 13:55:19 +00:00
Chris Baker
0762386a50 wip: upsert/delete scaling policies on job upsert/delete 2020-03-24 13:55:18 +00:00
Chris Baker
ee1b091e35 WIP: adding ScalingPolicy to api/structs and state store 2020-03-24 13:55:18 +00:00
Mahmood Ali
08e5a9087f Merge pull request #7414 from hashicorp/b-network-mode-change
Detect network mode change
2020-03-24 09:46:40 -04:00
Tim Gross
27aa97e69b csi: fix missing health count from volume list stub 2020-03-24 09:42:59 -04:00
Lang Martin
259311e7b0 csi: volume/plugin list should return an empty array, not nil (#7443)
* nomad/csi_endpoint: return an empty list, not nil

* nomad/csi_endpoint_test: volume list returns non-nil
2020-03-23 21:21:40 -04:00
Lang Martin
ce9dbe619f csi: the scheduler allows a job with a volume write claim to be updated (#7438)
* nomad/structs/csi: split CanWrite into health, in use

* scheduler/scheduler: expose AllocByID in the state interface

* nomad/state/state_store_test

* scheduler/stack: SetJobID on the matcher

* scheduler/feasible: when a volume writer is in use, check if it's us

* scheduler/feasible: remove SetJob

* nomad/state/state_store: denormalize allocs before Claim

* nomad/structs/csi: return errors on claim, with context

* nomad/csi_endpoint_test: new alloc doesn't look like an update

* nomad/state/state_store_test: change test reference to CanWrite
2020-03-23 21:21:04 -04:00
Drew Bailey
9e7a2b95cf Merge pull request #7444 from hashicorp/rename-auditor
make auditor interface more explicit
2020-03-23 20:23:28 -04:00
Drew Bailey
8e4d72f914 rename struct field to auditor 2020-03-23 20:09:01 -04:00
Mahmood Ali
57e7c85b0a Merge pull request #7238 from hashicorp/vendor-hcl-20190228
Update github.com/hashicorp/hcl
2020-03-23 20:00:33 -04:00
Mahmood Ali
e82b3b7146 Merge pull request #7384 from hashicorp/vendoring-tweaks-20200318
Vendor package cleanup
2020-03-23 19:48:12 -04:00
Drew Bailey
dafbf36458 make auditor interface more explicit 2020-03-23 19:32:58 -04:00
Mahmood Ali
cd12632c65 Merge pull request #7417 from hashicorp/f-allocstatus-lifecycle
cli: show lifecycle info in alloc status
2020-03-23 16:33:17 -04:00