You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/agent/main.go
+47-6Lines changed: 47 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,10 @@ type GrpcProxyAgentOptions struct {
64
64
proxyServerHoststring
65
65
proxyServerPortint
66
66
67
+
// Ports for the health and admin server
68
+
healthServerPortint
69
+
adminServerPortint
70
+
67
71
agentIDstring
68
72
syncInterval time.Duration
69
73
probeInterval time.Duration
@@ -92,6 +96,8 @@ func (o *GrpcProxyAgentOptions) Flags() *pflag.FlagSet {
92
96
flags.StringVar(&o.caCert, "ca-cert", o.caCert, "If non-empty the CAs we use to validate clients.")
93
97
flags.StringVar(&o.proxyServerHost, "proxy-server-host", o.proxyServerHost, "The hostname to use to connect to the proxy-server.")
94
98
flags.IntVar(&o.proxyServerPort, "proxy-server-port", o.proxyServerPort, "The port the proxy server is listening on.")
99
+
flags.IntVar(&o.healthServerPort, "health-server-port", o.healthServerPort, "The port the health server is listening on.")
100
+
flags.IntVar(&o.adminServerPort, "admin-server-port", o.adminServerPort, "The port the admin server is listening on.")
95
101
flags.StringVar(&o.agentID, "agent-id", o.agentID, "The unique ID of this agent. Default to a generated uuid if not set.")
96
102
flags.DurationVar(&o.syncInterval, "sync-interval", o.syncInterval, "The initial interval by which the agent periodically checks if it has connections to all instances of the proxy server.")
97
103
flags.DurationVar(&o.probeInterval, "probe-interval", o.probeInterval, "The interval by which the agent periodically checks if its connections to the proxy server are ready.")
@@ -106,6 +112,8 @@ func (o *GrpcProxyAgentOptions) Print() {
106
112
klog.Warningf("CACert set to \"%s\".\n", o.caCert)
107
113
klog.Warningf("ProxyServerHost set to \"%s\".\n", o.proxyServerHost)
108
114
klog.Warningf("ProxyServerPort set to %d.\n", o.proxyServerPort)
115
+
klog.Warningf("HealthServerPort set to %d.\n", o.healthServerPort)
116
+
klog.Warningf("AdminServerPort set to %d.\n", o.adminServerPort)
109
117
klog.Warningf("AgentID set to %s.\n", o.agentID)
110
118
klog.Warningf("SyncInterval set to %v.\n", o.syncInterval)
111
119
klog.Warningf("ProbeInterval set to %v.\n", o.probeInterval)
@@ -138,6 +146,13 @@ func (o *GrpcProxyAgentOptions) Validate() error {
138
146
ifo.proxyServerPort<=0 {
139
147
returnfmt.Errorf("proxy server port %d must be greater than 0", o.proxyServerPort)
140
148
}
149
+
ifo.healthServerPort<=0 {
150
+
returnfmt.Errorf("health server port %d must be greater than 0", o.healthServerPort)
151
+
}
152
+
ifo.adminServerPort<=0 {
153
+
returnfmt.Errorf("admin server port %d must be greater than 0", o.adminServerPort)
0 commit comments