mirror of
https://github.com/kemko/nomad.git
synced 2026-01-02 00:15:43 +03:00
The Nomad client will have its identity renewed according to the TTL which defaults to 24h. In certain situations such as root keyring rotation, operators may want to force clients to renew their identities before the TTL threshold is met. This change introduces a client HTTP and RPC endpoint which will instruct the node to request a new identity at its next heartbeat. This can be used via the API or a new command. While this is a manual intervention step on top of the any keyring rotation, it dramatically reduces the initial feature complexity as it provides an asynchronous and efficient method of renewal that utilises existing functionality.
35 lines
794 B
Go
35 lines
794 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package command
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/hashicorp/cli"
|
|
)
|
|
|
|
type NodeIdentityCommand struct {
|
|
Meta
|
|
}
|
|
|
|
func (n *NodeIdentityCommand) Help() string {
|
|
helpText := `
|
|
Usage: nomad node identity [subcommand]
|
|
|
|
Interact with a node's identity. All commands interact directly with a client
|
|
and require setting the target node via its 36 character ID.
|
|
|
|
Please see the individual subcommand help for detailed usage information.
|
|
`
|
|
return strings.TrimSpace(helpText)
|
|
}
|
|
|
|
func (n *NodeIdentityCommand) Synopsis() string { return "Force renewal of a nodes identity" }
|
|
|
|
func (n *NodeIdentityCommand) Name() string { return "node identity" }
|
|
|
|
func (n *NodeIdentityCommand) Run(_ []string) int {
|
|
return cli.RunResultHelp
|
|
}
|