-
Notifications
You must be signed in to change notification settings - Fork 552
/
config.go
82 lines (69 loc) · 2.35 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright 2021 Vectorized, Inc.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.md
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0
package config
import (
"github.com/spf13/afero"
"github.com/spf13/cobra"
"github.com/vectorizedio/redpanda/src/go/rpk/pkg/cli/cmd/common"
"github.com/vectorizedio/redpanda/src/go/rpk/pkg/config"
)
func NewConfigCommand(fs afero.Fs) *cobra.Command {
var (
all bool
adminURL string
adminEnableTLS bool
adminCertFile string
adminKeyFile string
adminCAFile string
)
command := &cobra.Command{
Use: "config",
Args: cobra.ExactArgs(0),
Short: "Interact with cluster configuration properties.",
Long: `Interact with cluster configuration properties.
Cluster properties are redpanda settings which apply to all nodes in
the cluster. These are separate to node properties, which are set with
'rpk redpanda config'.
Use the 'edit' subcommand to interactively modify the cluster configuration, or
'export' and 'import' to write configuration to a file that can be edited and
read back later.
These commands take an optional '--all' flag to include all properties including
low level tunables such as internal buffer sizes, that do not usually need
to be changed during normal operations. These properties generally require
some expertize to set safely, so if in doubt, avoid using '--all'.
Modified properties are propagated immediately to all nodes. The 'status'
subcommand can be used to verify that all nodes are up to date, and identify
any settings which were rejected by a node, for example if a node is running a
different redpanda version that does not recognize certain properties.`,
}
command.PersistentFlags().StringVar(
&adminURL,
config.FlagAdminHosts2,
"",
"Comma-separated list of admin API addresses (<IP>:<port>")
common.AddAdminAPITLSFlags(command,
&adminEnableTLS,
&adminCertFile,
&adminKeyFile,
&adminCAFile,
)
command.PersistentFlags().BoolVar(
&all,
"all",
false,
"Include all properties, including tunables.",
)
command.AddCommand(
newImportCommand(fs, &all),
newExportCommand(fs, &all),
newEditCommand(fs, &all),
newStatusCommand(fs),
)
return command
}