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/app/options/options.go
+11
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,8 @@ type GrpcProxyAgentOptions struct {
89
89
LeaseNamespacestring
90
90
// Labels on which lease objects are managed.
91
91
LeaseLabelstring
92
+
// ServerCountSource describes how server counts should be combined.
93
+
ServerCountSourcestring
92
94
// Path to kubeconfig (used by kubernetes client for lease listing)
93
95
KubeconfigPathstring
94
96
// Content type of requests sent to apiserver.
@@ -108,6 +110,7 @@ func (o *GrpcProxyAgentOptions) ClientSetConfig(dialOptions ...grpc.DialOption)
108
110
WarnOnChannelLimit: o.WarnOnChannelLimit,
109
111
SyncForever: o.SyncForever,
110
112
XfrChannelSize: o.XfrChannelSize,
113
+
ServerCountSource: o.ServerCountSource,
111
114
}
112
115
}
113
116
@@ -138,6 +141,7 @@ func (o *GrpcProxyAgentOptions) Flags() *pflag.FlagSet {
138
141
flags.BoolVar(&o.CountServerLeases, "count-server-leases", o.CountServerLeases, "Enables lease counting system to determine the number of proxy servers to connect to.")
139
142
flags.StringVar(&o.LeaseNamespace, "lease-namespace", o.LeaseNamespace, "Namespace where lease objects are managed.")
140
143
flags.StringVar(&o.LeaseLabel, "lease-label", o.LeaseLabel, "The labels on which the lease objects are managed.")
144
+
flags.StringVar(&o.ServerCountSource, "server-count-source", o.ServerCountSource, "Defines how the server counts from lease and from server responses are combined. Possible values: 'default' to use only one source (server or leases depending on other flags), 'max' to take the larger value.")
141
145
flags.StringVar(&o.KubeconfigPath, "kubeconfig", o.KubeconfigPath, "Path to the kubeconfig file")
142
146
flags.StringVar(&o.APIContentType, "kube-api-content-type", o.APIContentType, "Content type of requests sent to apiserver.")
143
147
returnflags
@@ -168,6 +172,7 @@ func (o *GrpcProxyAgentOptions) Print() {
168
172
klog.V(1).Infof("CountServerLeases set to %v.\n", o.CountServerLeases)
169
173
klog.V(1).Infof("LeaseNamespace set to %s.\n", o.LeaseNamespace)
170
174
klog.V(1).Infof("LeaseLabel set to %s.\n", o.LeaseLabel)
175
+
klog.V(1).Infof("ServerCountSource set to %s.\n", o.ServerCountSource)
171
176
klog.V(1).Infof("ChannelSize set to %d.\n", o.XfrChannelSize)
172
177
klog.V(1).Infof("APIContentType set to %v.\n", o.APIContentType)
173
178
}
@@ -232,6 +237,11 @@ func (o *GrpcProxyAgentOptions) Validate() error {
0 commit comments