Skip to content

Commit

Permalink
docs: include new opertor scheduler CLI and pause eval API info.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasell committed Jul 1, 2022
1 parent 1142757 commit f985774
Show file tree
Hide file tree
Showing 7 changed files with 197 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .changelog/13045.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:improvement
cli: Added `scheduler get-config` and `scheduler set-config` commands to the operator CLI
```

```release-note:improvement
core: Added the ability to pause and un-pause the eval broker and blocked eval broker
```
56 changes: 42 additions & 14 deletions website/content/api-docs/operator/scheduler.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,20 @@ $ curl \
"Index": 5,
"KnownLeader": true,
"LastContact": 0,
"NextToken": "",
"SchedulerConfig": {
"CreateIndex": 5,
"MemoryOversubscriptionEnabled": false,
"ModifyIndex": 5,
"SchedulerAlgorithm": "spread",
"MemoryOversubscriptionEnabled": true,
"RejectJobRegistration": false,
"PauseEvalBroker": false,
"PreemptionConfig": {
"SystemSchedulerEnabled": true,
"SysBatchSchedulerEnabled": false,
"BatchSchedulerEnabled": false,
"ServiceSchedulerEnabled": false
}
"ServiceSchedulerEnabled": false,
"SysBatchSchedulerEnabled": false,
"SystemSchedulerEnabled": true
},
"RejectJobRegistration": false,
"SchedulerAlgorithm": "binpack"
}
}
```
Expand All @@ -64,9 +66,23 @@ $ curl \
- `SchedulerConfig` `(SchedulerConfig)` - The returned `SchedulerConfig` object has configuration
settings mentioned below.

- `SchedulerAlgorithm` `(string: "binpack")` - Specifies whether scheduler binpacks or spreads allocations on available nodes.
- `SchedulerAlgorithm` `(string: "binpack")` - Specifies whether scheduler
binpacks or spreads allocations on available nodes.

- `MemoryOversubscriptionEnabled` `(bool: false)` <sup>1.1 Beta</sup> - When `true`, tasks may exceed their reserved memory limit, if the client has excess memory capacity. Tasks must specify [`memory_max`](/docs/job-specification/resources#memory_max) to take advantage of memory oversubscription.
- `MemoryOversubscriptionEnabled` `(bool: false)` <sup>1.1 Beta</sup> - When
`true`, tasks may exceed their reserved memory limit, if the client has excess
memory capacity. Tasks must specify [`memory_max`](/docs/job-specification/resources#memory_max)
to take advantage of memory oversubscription.

- `RejectJobRegistration` `(bool: false)` - When `true`, the server will return
permission denied errors for job registration, job dispatch, and job scale APIs,
unless the ACL token for the request is a management token. If ACLs are disabled,
no user will be able to register jobs. This allows operators to shed load from
automated processes during incident response.

- `PauseEvalBroker` `(bool: false)` - When set to `true`, the eval broker which
usually runs on the leader will be disabled. This will prevent the scheduler
workers from receiving new work.

- `PreemptionConfig` `(PreemptionConfig)` - Options to enable preemption for various schedulers.

Expand Down Expand Up @@ -120,6 +136,7 @@ server state is authoritative.
"SchedulerAlgorithm": "spread",
"MemoryOversubscriptionEnabled": false,
"RejectJobRegistration": false,
"PauseEvalBroker": false,
"PreemptionConfig": {
"SystemSchedulerEnabled": true,
"SysBatchSchedulerEnabled": false,
Expand All @@ -133,19 +150,30 @@ server state is authoritative.
binpacks or spreads allocations on available nodes. Possible values are
`"binpack"` and `"spread"`

- `MemoryOversubscriptionEnabled` `(bool: false)` <sup>1.1 Beta</sup> - When `true`, tasks may exceed their reserved memory limit, if the client has excess memory capacity. Tasks must specify [`memory_max`](/docs/job-specification/resources#memory_max) to take advantage of memory oversubscription.
- `MemoryOversubscriptionEnabled` `(bool: false)` <sup>1.1 Beta</sup> - When
`true`, tasks may exceed their reserved memory limit, if the client has excess
memory capacity. Tasks must specify [`memory_max`](/docs/job-specification/resources#memory_max)
to take advantage of memory oversubscription.

- `RejectJobRegistration` `(bool: false)` - When `true`, the server will return permission denied errors for job registration, job dispatch, and job scale APIs, unless the ACL token for the request is a management token. If ACLs are disabled, no user will be able to register jobs. This allows operators to shed load from automated proceses during incident response.
- `RejectJobRegistration` `(bool: false)` - When `true`, the server will return
permission denied errors for job registration, job dispatch, and job scale APIs,
unless the ACL token for the request is a management token. If ACLs are disabled,
no user will be able to register jobs. This allows operators to shed load from
automated processes during incident response.

- `PauseEvalBroker` `(bool: false)` - When set to `true`, the eval broker which
usually runs on the leader will be disabled. This will prevent the scheduler
workers from receiving new work.

- `PreemptionConfig` `(PreemptionConfig)` - Options to enable preemption for
various schedulers.

- `SystemSchedulerEnabled` `(bool: true)` - Specifies whether preemption for
system jobs is enabled. Note that if this is set to true, then system jobs
can preempt any other jobs.
- `SysBatchSchedulerEnabled` `(bool: false)` <sup>1.2</sup> - Specifies
whether preemption for system batch jobs is enabled. Note that if this is

- `SysBatchSchedulerEnabled` `(bool: false)` <sup>1.2</sup> - Specifies
whether preemption for system batch jobs is enabled. Note that if this is
set to true, then system batch jobs can preempt any other jobs.

- `BatchSchedulerEnabled` `(bool: false)` - Specifies
Expand Down
8 changes: 8 additions & 0 deletions website/content/docs/commands/operator/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ The following subcommands are available:
- [`operator raft remove-peer`][remove] - Remove a Nomad server from the Raft
configuration

- [`operator scheduler get-config`][scheduler-get-config] - Display the current
scheduler configuration

- [`operator scheduler set-config`][scheduler-set-config] - Modify the scheduler
configuration

- [`operator snapshot agent`][snapshot-agent] <EnterpriseAlert inline /> - Inspects a snapshot of the Nomad server state

- [`operator snapshot save`][snapshot-save] - Saves a snapshot of the Nomad server state
Expand All @@ -63,3 +69,5 @@ The following subcommands are available:
[snapshot-restore]: /docs/commands/operator/snapshot-restore 'Snapshot Restore command'
[snapshot-inspect]: /docs/commands/operator/snapshot-inspect 'Snapshot Inspect command'
[snapshot-agent]: /docs/commands/operator/snapshot-agent 'Snapshot Agent command'
[scheduler-get-config]: /docs/commands/operator/scheduler-get-config 'Scheduler Get Config command'
[scheduler-set-config]: /docs/commands/operator/scheduler-set-config 'Scheduler Set Config command'
47 changes: 47 additions & 0 deletions website/content/docs/commands/operator/scheduler-get-config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
layout: docs
page_title: 'Commands: operator scheduler get-config'
description: |
Display the current scheduler configuration.
---

# Command: operator scheduler get-config

The scheduler operator get-config command is used to view the current scheduler
configuration.

## Usage

```plaintext
nomad operator scheduler get-config [options]
```

If ACLs are enabled, this command requires a token with the `operator:read`
capability.

## General Options

@include 'general_options_no_namespace.mdx'

## Get Config Options

- `-json`: Output the scheduler config in its JSON format.

- `-t`: Format and display the scheduler config using a Go template.

## Examples

Display the current scheduler configuration:

```shell-session
$ nomad operator scheduler get-config
Scheduler Algorithm = binpack
Memory Oversubscription = false
Reject Job Registration = false
Pause Eval Broker = false
Preemption System Scheduler = true
Preemption Service Scheduler = false
Preemption Batch Scheduler = false
Preemption SysBatch Scheduler = false
Modify Index = 5
```
82 changes: 82 additions & 0 deletions website/content/docs/commands/operator/scheduler-set-config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
layout: docs
page_title: 'Commands: operator scheduler set-config'
description: |
Modify the scheduler configuration.
---

# Command: operator scheduler set-config

The scheduler operator set-config command is used to modify the scheduler
configuration.

## Usage

```plaintext
nomad operator scheduler set-config [options]
```

If ACLs are enabled, this command requires a token with the `operator:write`
capability.

## General Options

@include 'general_options_no_namespace.mdx'

## Set Config Options

- `-check-index` - If set, the scheduler config is only updated if the passed
modify index matches the current server side version. If a non-zero value is
passed, it ensures that the scheduler config is being updated from a known
state.

- `-scheduler-algorithm` - Specifies whether scheduler binpacks or spreads
allocations on available nodes. Must be one of `["binpack"|"spread"]`.

- `-memory-oversubscription` - When true, tasks may exceed their reserved memory
limit, if the client has excess memory capacity. Tasks must specify [`memory_max`]
to take advantage of memory oversubscription. Must be one of `[true|false]`.

- `-reject-job-registration` - When true, the server will return permission denied
errors for job registration, job dispatch, and job scale APIs, unless the ACL
token for the request is a management token. If ACLs are disabled, no user
will be able to register jobs. This allows operators to shed load from automated
processes during incident response. Must be one of `[true|false]`.

- `-pause-eval-broker` - When set to true, the eval broker which usually runs on
the leader will be disabled. This will prevent the scheduler workers from
receiving new work. Must be one of `[true|false]`.

- `-preempt-batch-scheduler` - Specifies whether preemption for batch jobs
is enabled. Note that if this is set to true, then batch jobs can preempt any
other jobs. Must be one of `[true|false]`.

- `-preempt-service-scheduler` - Specifies whether preemption for service jobs
is enabled. Note that if this is set to true, then service jobs can preempt any
other jobs. Must be one of `[true|false]`.

- `-preempt-sysbatch-scheduler` - Specifies whether preemption for system batch
jobs is enabled. Note that if this is set to true, then system batch jobs can
preempt any other jobs. Must be one of `[true|false]`.

- `-preempt-system-scheduler` - Specifies whether preemption for system jobs
is enabled. Note that if this is set to true, then system jobs can preempt any
other jobs. Must be one of `[true|false]`.

## Examples

Modify the scheduler algorithm to spread:

```shell-session
$ nomad operator scheduler set-config -scheduler-algorithm=spread
Scheduler configuration updated!
```

Modify the scheduler algorithm to spread using the check index flag:

```shell-session
$ nomad operator scheduler set-config -scheduler-algorithm=spread -check-index=5
Scheduler configuration updated!
```

[`memory_max`]: /docs/job-specification/resources#memory_max
7 changes: 3 additions & 4 deletions website/content/docs/configuration/server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,10 @@ job-type schedulers.
```hcl
server {
default_scheduler_config {
scheduler_algorithm = "spread"
scheduler_algorithm = "spread"
memory_oversubscription_enabled = true
reject_job_registration = false
reject_job_registration = false
pause_eval_broker = false # New in Nomad 1.3.2
preemption_config {
batch_scheduler_enabled = true
Expand Down
8 changes: 8 additions & 0 deletions website/data/docs-nav-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,14 @@
"title": "raft state",
"path": "commands/operator/raft-state"
},
{
"title": "scheduler get-config",
"path": "commands/operator/scheduler-get-config"
},
{
"title": "scheduler set-config",
"path": "commands/operator/scheduler-set-config"
},
{
"title": "snapshot agent",
"path": "commands/operator/snapshot-agent"
Expand Down

0 comments on commit f985774

Please sign in to comment.