Skip to content

Commit 9606df6

Browse files
authored
Merge pull request #6784 from yanggangtony/node-agent-metrics-addr
Fix node-agent missing metrics-addr parms to define the server start. #6784
2 parents ad114f8 + 069c280 commit 9606df6

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix the node-agent missing metrics-address defines.

pkg/cmd/cli/nodeagent/server.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func NewServerCommand(f client.Factory) *cobra.Command {
114114
command.Flags().Var(formatFlag, "log-format", fmt.Sprintf("The format for log output. Valid values are %s.", strings.Join(formatFlag.AllowedValues(), ", ")))
115115
command.Flags().DurationVar(&config.resourceTimeout, "resource-timeout", config.resourceTimeout, "How long to wait for resource processes which are not covered by other specific timeout parameters. Default is 10 minutes.")
116116
command.Flags().DurationVar(&config.dataMoverPrepareTimeout, "data-mover-prepare-timeout", config.dataMoverPrepareTimeout, "How long to wait for preparing a DataUpload/DataDownload. Default is 30 minutes.")
117+
command.Flags().StringVar(&config.metricsAddress, "metrics-address", config.metricsAddress, "The address to expose prometheus metrics")
117118

118119
return command
119120
}
@@ -193,14 +194,15 @@ func newNodeAgentServer(logger logrus.FieldLogger, factory client.Factory, confi
193194
}
194195

195196
s := &nodeAgentServer{
196-
logger: logger,
197-
ctx: ctx,
198-
cancelFunc: cancelFunc,
199-
fileSystem: filesystem.NewFileSystem(),
200-
mgr: mgr,
201-
config: config,
202-
namespace: factory.Namespace(),
203-
nodeName: nodeName,
197+
logger: logger,
198+
ctx: ctx,
199+
cancelFunc: cancelFunc,
200+
fileSystem: filesystem.NewFileSystem(),
201+
mgr: mgr,
202+
config: config,
203+
namespace: factory.Namespace(),
204+
nodeName: nodeName,
205+
metricsAddress: config.metricsAddress,
204206
}
205207

206208
// the cache isn't initialized yet when "validatePodVolumesHostPath" is called, the client returned by the manager cannot

pkg/install/daemonset.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ func DaemonSet(namespace string, opts ...podTemplateOption) *appsv1.DaemonSet {
105105
{
106106
Name: "node-agent",
107107
Image: c.image,
108+
Ports: containerPorts(),
108109
ImagePullPolicy: pullPolicy,
109110
Command: []string{
110111
"/velero",

0 commit comments

Comments
 (0)