docs: add new scaling command website documentation. (#9143)

Co-authored-by: Chris Baker <1675087+cgbaker@users.noreply.github.com>
This commit is contained in:
James Rasell 2020-10-27 07:15:11 +01:00 committed by GitHub
parent 86080e25a9
commit 592c28c6ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 130 additions and 0 deletions

View File

@ -161,6 +161,7 @@ export default [
category: 'quota',
content: ['apply', 'delete', 'init', 'inspect', 'list', 'status'],
},
{ category: 'scaling', content: ['policy-info', 'policy-list'] },
{ category: 'sentinel', content: ['apply', 'delete', 'list', 'read'] },
{ category: 'server', content: ['force-leave', 'join', 'members'] },
'status',

View File

@ -0,0 +1,26 @@
---
layout: docs
page_title: 'Commands: scaling'
sidebar_title: scaling
description: |
The scaling command is used to interact with the scaling API.
---
# Command: scaling
The `scaling` command is used to interact with the scaling API.
~> Scaling commands are new in Nomad 1.0.
## Usage
Usage: `nomad scaling <subcommand> [options]`
Run `nomad scaling <subcommand> -h` for help on that subcommand. The following
subcommands are available:
- [`policy info`][scalingpolicyinfo] - Display an individual Nomad scaling policy
- [`policy list`][scalingpolicylist] - List all Nomad scaling policies
[scalingpolicyinfo]: /docs/commands/scaling/policy-info
[scalingpolicylist]: /docs/commands/scaling/policy-list

View File

@ -0,0 +1,65 @@
---
layout: docs
page_title: 'Commands: scaling policy info'
sidebar_title: policy info
description: |
Display an individual Nomad scaling policy.
---
# Command: scaling policy info
Info is used to return detailed information on the specified scaling policy.
## Usage
```plaintext
nomad scaling policy info [options] <policy_id>
```
## General Options
@include 'general_options.mdx'
## Policy Info Options
- `-json` : Output the scaling policy in its JSON format.
- `-t` : Format and display the scaling policy using a Go template.
## Examples
Inspect an individual scaling policy:
```shell-session
$ nomad scaling policy info 31a53813-24df-b2ad-77dc-1b4bad4e7dca
ID = 31a53813-24df-b2ad-77dc-1b4bad4e7dca
Enabled = true
Target = Namespace:default,Job:webapp,Group:demo
Min = 1
Max = 20
Policy:
{
"check": [
{
"avg_sessions": [
{
"query": "scalar(sum(traefik_entrypoint_open_connections{entrypoint=\"horizontal-webapp\"}))",
"source": "prometheus",
"strategy": [
{
"target-value": [
{
"target": 10.0
}
]
}
]
}
]
}
],
"cooldown": "1m",
"evaluation_interval": "30s"
}
```

View File

@ -0,0 +1,38 @@
---
layout: docs
page_title: 'Commands: scaling policy list'
sidebar_title: policy list
description: |
Display all Nomad scaling policies.
---
# Command: scaling policy list
List is used to list all scaling policies stored in Nomad.
## Usage
```plaintext
nomad scaling policy list [options]
```
## General Options
@include 'general_options.mdx'
## Policy List Options
- `-json` : Output the scaling policy list in its JSON format.
- `-t` : Format and display the scaling policy list using a Go template.
## Examples
List all tracked scaling policies:
```shell-session
$ nomad scaling policy list
ID Enabled Target
b2c64295-4315-2fdc-6158-a27156808729 true Namespace:default,Job:example,Group:cache,Task:redis
c355d0ec-7aa1-2604-449d-4ec79c813d2c true Namespace:default,Job:webapp,Group:demo,Task:webapp
```