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
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,10 @@ 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
88
92
// Path to kubeconfig (used by kubernetes client for lease listing)
89
93
KubeconfigPathstring
90
94
// Content type of requests sent to apiserver.
@@ -132,6 +136,8 @@ func (o *GrpcProxyAgentOptions) Flags() *pflag.FlagSet {
132
136
flags.BoolVar(&o.SyncForever, "sync-forever", o.SyncForever, "If true, the agent continues syncing, in order to support server count changes.")
133
137
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
138
flags.BoolVar(&o.CountServerLeases, "count-server-leases", o.CountServerLeases, "Enables lease counting system to determine the number of proxy servers to connect to.")
139
+
flags.StringVar(&o.LeaseNamespace, "lease-namespace", o.LeaseNamespace, "Namespace where lease objects are managed.")
140
+
flags.StringVar(&o.LeaseLabel, "lease-label", o.LeaseLabel, "The labels on which the lease objects are managed.")
135
141
flags.StringVar(&o.KubeconfigPath, "kubeconfig", o.KubeconfigPath, "Path to the kubeconfig file")
136
142
flags.StringVar(&o.APIContentType, "kube-api-content-type", o.APIContentType, "Content type of requests sent to apiserver.")
137
143
returnflags
@@ -159,6 +165,9 @@ func (o *GrpcProxyAgentOptions) Print() {
159
165
klog.V(1).Infof("AgentIdentifiers set to %s.\n", util.PrettyPrintURL(o.AgentIdentifiers))
160
166
klog.V(1).Infof("WarnOnChannelLimit set to %t.\n", o.WarnOnChannelLimit)
161
167
klog.V(1).Infof("SyncForever set to %v.\n", o.SyncForever)
168
+
klog.V(1).Infof("CountServerLeases set to %v.\n", o.CountServerLeases)
169
+
klog.V(1).Infof("LeaseNamespace set to %s.\n", o.LeaseNamespace)
170
+
klog.V(1).Infof("LeaseLabel set to %s.\n", o.LeaseLabel)
162
171
klog.V(1).Infof("ChannelSize set to %d.\n", o.XfrChannelSize)
163
172
klog.V(1).Infof("APIContentType set to %v.\n", o.APIContentType)
164
173
}
@@ -216,6 +225,13 @@ func (o *GrpcProxyAgentOptions) Validate() error {
Copy file name to clipboardExpand all lines: cmd/server/app/options/options.go
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,10 @@ type ProxyRunOptions struct {
108
108
109
109
// Lease controller configuration
110
110
EnableLeaseControllerbool
111
+
// Lease Namespace
112
+
LeaseNamespacestring
113
+
// Lease Labels
114
+
LeaseLabelstring
111
115
}
112
116
113
117
func (o*ProxyRunOptions) Flags() *pflag.FlagSet {
@@ -146,6 +150,8 @@ func (o *ProxyRunOptions) Flags() *pflag.FlagSet {
146
150
flags.StringSliceVar(&o.CipherSuites, "cipher-suites", o.CipherSuites, "The comma separated list of allowed cipher suites. Has no effect on TLS1.3. Empty means allow default list.")
147
151
flags.IntVar(&o.XfrChannelSize, "xfr-channel-size", o.XfrChannelSize, "The size of the two KNP server channels used in server for transferring data. One channel is for data coming from the Kubernetes API Server, and the other one is for data coming from the KNP agent.")
148
152
flags.BoolVar(&o.EnableLeaseController, "enable-lease-controller", o.EnableLeaseController, "Enable lease controller to publish and garbage collect proxy server leases.")
153
+
flags.StringVar(&o.LeaseNamespace, "lease-namespace", o.LeaseNamespace, "The namespace where lease objects are managed by the controller.")
154
+
flags.StringVar(&o.LeaseLabel, "lease-label", o.LeaseLabel, "The labels on which the lease objects are managed.")
149
155
flags.Bool("warn-on-channel-limit", true, "This behavior is now thread safe and always on. This flag will be removed in a future release.")
150
156
flags.MarkDeprecated("warn-on-channel-limit", "This behavior is now thread safe and always on. This flag will be removed in a future release.")
151
157
@@ -184,6 +190,9 @@ func (o *ProxyRunOptions) Print() {
184
190
klog.V(1).Infof("KubeconfigBurst set to %d.\n", o.KubeconfigBurst)
185
191
klog.V(1).Infof("APIContentType set to %v.\n", o.APIContentType)
186
192
klog.V(1).Infof("ProxyStrategies set to %q.\n", o.ProxyStrategies)
193
+
klog.V(1).Infof("EnableLeaseController set to %v.\n", o.EnableLeaseController)
194
+
klog.V(1).Infof("LeaseNamespace set to %s.\n", o.LeaseNamespace)
195
+
klog.V(1).Infof("LeaseLabel set to %s.\n", o.LeaseLabel)
187
196
klog.V(1).Infof("CipherSuites set to %q.\n", o.CipherSuites)
188
197
klog.V(1).Infof("XfrChannelSize set to %d.\n", o.XfrChannelSize)
189
198
}
@@ -321,6 +330,13 @@ func (o *ProxyRunOptions) Validate() error {
0 commit comments