-
Notifications
You must be signed in to change notification settings - Fork 12
Backport kontena/kontena#2504 node token docs #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
6489f1b
ee8b863
98fe3e7
7fdb03c
771e8b8
43446d5
fbe74df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,12 +17,29 @@ In this chapter, we'll discover how to manage, operate and monitor Kontena Nodes | |
|
|
||
| Please see the [Add Kontena Nodes](install-nodes/README.md) documentation to learn more. | ||
|
|
||
| ## Create Kontena Nodes | ||
|
|
||
| Create a new Kontena Node for manual provisioning: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So the Writing up the detailed docs in |
||
|
|
||
| ``` | ||
| $ kontena node create core-03 | ||
| [done] Creating core-03 node | ||
| ``` | ||
|
|
||
| The server will generate a random node token by default. Use `--token` to supply a pre-generated node token. | ||
|
|
||
| The new node must be provisioned using the `kontena node env` configuration. | ||
|
|
||
| ## List Kontena Nodes | ||
|
|
||
| The command that may be used for listing all Kontena Nodes in a Kontena Platform. | ||
|
|
||
| ``` | ||
| $ kontena node list | ||
| NAME VERSION STATUS INITIAL LABELS | ||
| ⊛ core-01 1.4.0 online 1 / 1 provider=vagrant | ||
| ⊛ core-02 1.4.0 online - provider=vagrant | ||
| ⊝ core-03 1.4.0 offline - - | ||
| ``` | ||
|
|
||
| ## Show Kontena Node Information | ||
|
|
@@ -33,6 +50,18 @@ The command that may be used for inspecting Kontena Node information. | |
| $ kontena node show <NODE_ID> | ||
| ``` | ||
|
|
||
| ## Show Kontena Node Configuration | ||
|
|
||
| Generate the [`/etc/kontena-agent.env` environment variables](../references/environment-variables#kontena-agent) required when manually provisioning nodes using node tokens: | ||
|
|
||
| ``` | ||
| $ kontena node env core-03 | ||
| KONTENA_URI=ws://192.168.66.1:9292/ | ||
| KONTENA_NODE_TOKEN=yempbjWHbZLhc66gB0mAFXKS8HzS/daDwCfnHC+UfrJo5wkhQ6hpr8XKY5nUdH+h6CH81Y9bQIc4IgTcEEjQCQ== | ||
| ``` | ||
|
|
||
| See [`kontena grid env`](./platform.md#show-kontena-node-configuration) or [`kontena node reset-token`](#reset-a-kontena-node-token) if the node was not created using `kontena node create`. | ||
|
|
||
| ## Update Kontena Node Information | ||
|
|
||
| ``` | ||
|
|
@@ -47,15 +76,30 @@ The command that may be used for connecting to Kontena Node via SSH. | |
| $ kontena node ssh <NODE_ID> | ||
| ``` | ||
|
|
||
| ## Reset a Kontena Node Token | ||
|
|
||
| The `kontena node reset-token` command can be used to replace a compromised node token, upgrade a node that was originally provisioned using a grid token, or revert a node to using a grid token: | ||
|
|
||
| ``` | ||
| $ kontena node reset-token <NODE_ID> | ||
| ``` | ||
|
|
||
| Resetting the token of an online Kontena Node will force the agent to disconnect. The agent will not be able to reconnect until the the node is reconfigured using the new `kontena node env` values. | ||
|
|
||
| The `kontena node reset-token` command can also be used to upgrade a node provisioned using a grid token. The node must be reconfigured using the new `kontena node env` configuration before it will be able to reconnect. The `kontena node reset-token --clear-token` command can be used to revert back to the grid token. | ||
|
|
||
|
|
||
| ## Remove a Kontena Node | ||
|
|
||
| In order to remove a Kontena Node, it must be terminated first. Once terminated, it may be removed. Only `offline` Kontena Nodes may be removed. | ||
| The `kontena node remove` command can be used to remove a node that is being decomissioned: | ||
|
|
||
| ``` | ||
| $ kontena node remove <NODE_ID> | ||
| ``` | ||
|
|
||
| If you are using the Kontena CLI built-in provision tool, you can terminate Kontena Node using the `kontena <provider> node terminate` command. Alternatively, power off / terminate the Kontena Node machine from any infrastructure you are using and wait for the machine to become offline before removing them. | ||
| If the node was provisioned using the Kontena CLI built-in provisioning tool, you can terminate the host machine using the `kontena <provider> node terminate` command. This will also remove the Kontena Node. If the host machine has already been terminated, then the `kontena node remove` command can be used to forget the terminated node. | ||
|
|
||
| If the node was provisioned with a node token, then the `kontena node remove` command can also be used to invalidate the node token, forcing the agent to disconnect if it is still connected. Nodes provisioned using grid tokens cannot be removed if they are still online, because the agent would simply reconnect and the node would quickly re-appear. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There are now two kinds of nodes: those with grid tokens and those with node tokens. They behave differently in terms of The Should we drop support for removing online nodes connected using node tokens, to simplify the docs? You could still use |
||
|
|
||
| **IMPORTANT!** If you remove a Kontena Node that has `stateful` Kontena Service instances deployed, those Kontena Service instances will be re-scheduled for the next Kontena Service deploy and lose their state. | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This links to the "Kontena Agent" section on the environment variables reference. Do we also want to avoid the mention of
/etc/kontena-agent.envhere?