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
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,12 @@ type GrpcProxyAgentOptions struct {
85
85
// Enables updating the server count by counting the number of valid leases
86
86
// matching the selector.
87
87
CountServerLeasesbool
88
+
// Namespace where lease objects are managed.
89
+
LeaseNamespacestring
90
+
// Labels on which lease objects are managed.
91
+
LeaseLabelstring
92
+
// ServerCountSource describes how server counts should be combined.
93
+
ServerCountSourcestring
88
94
// Path to kubeconfig (used by kubernetes client for lease listing)
89
95
KubeconfigPathstring
90
96
// Content type of requests sent to apiserver.
@@ -104,6 +110,7 @@ func (o *GrpcProxyAgentOptions) ClientSetConfig(dialOptions ...grpc.DialOption)
104
110
WarnOnChannelLimit: o.WarnOnChannelLimit,
105
111
SyncForever: o.SyncForever,
106
112
XfrChannelSize: o.XfrChannelSize,
113
+
ServerCountSource: o.ServerCountSource,
107
114
}
108
115
}
109
116
@@ -132,6 +139,9 @@ func (o *GrpcProxyAgentOptions) Flags() *pflag.FlagSet {
132
139
flags.BoolVar(&o.SyncForever, "sync-forever", o.SyncForever, "If true, the agent continues syncing, in order to support server count changes.")
133
140
flags.IntVar(&o.XfrChannelSize, "xfr-channel-size", 150, "Set the size of the channel for transferring data between the agent and the proxy server.")
134
141
flags.BoolVar(&o.CountServerLeases, "count-server-leases", o.CountServerLeases, "Enables lease counting system to determine the number of proxy servers to connect to.")
142
+
flags.StringVar(&o.LeaseNamespace, "lease-namespace", o.LeaseNamespace, "Namespace where lease objects are managed.")
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.")
135
145
flags.StringVar(&o.KubeconfigPath, "kubeconfig", o.KubeconfigPath, "Path to the kubeconfig file")
136
146
flags.StringVar(&o.APIContentType, "kube-api-content-type", o.APIContentType, "Content type of requests sent to apiserver.")
137
147
returnflags
@@ -159,6 +169,10 @@ func (o *GrpcProxyAgentOptions) Print() {
159
169
klog.V(1).Infof("AgentIdentifiers set to %s.\n", util.PrettyPrintURL(o.AgentIdentifiers))
160
170
klog.V(1).Infof("WarnOnChannelLimit set to %t.\n", o.WarnOnChannelLimit)
161
171
klog.V(1).Infof("SyncForever set to %v.\n", o.SyncForever)
172
+
klog.V(1).Infof("CountServerLeases set to %v.\n", o.CountServerLeases)
173
+
klog.V(1).Infof("LeaseNamespace set to %s.\n", o.LeaseNamespace)
174
+
klog.V(1).Infof("LeaseLabel set to %s.\n", o.LeaseLabel)
175
+
klog.V(1).Infof("ServerCountSource set to %s.\n", o.ServerCountSource)
162
176
klog.V(1).Infof("ChannelSize set to %d.\n", o.XfrChannelSize)
163
177
klog.V(1).Infof("APIContentType set to %v.\n", o.APIContentType)
164
178
}
@@ -216,6 +230,18 @@ func (o *GrpcProxyAgentOptions) Validate() error {
0 commit comments