@@ -15,38 +15,16 @@ import (
1515)
1616
1717const (
18- // ConfigMapsNamespace is the value used to filter the ConfigMaps Resource in the Informer.
19- ConfigMapsNamespace = "nlk"
20-
21- // ConfigMapName is the name of the ConfigMap that contains the configuration for the application.
22- ConfigMapName = "nlk-config"
23-
24- // ResyncPeriod is the value used to set the resync period for the Informer.
25- ResyncPeriod = 0
26-
27- // NlkPrefix is used to determine if a Port definition should be handled and used to update a Border Server.
28- // The Port name () must start with this prefix, e.g.:
29- // nlk-<my-upstream-name>
30- NlkPrefix = ConfigMapsNamespace + "-"
31-
32- // PortAnnotationPrefix defines the prefix used when looking up a Port in the Service Annotations.
33- // The value of the annotation determines which BorderServer implementation will be used.
34- // See the documentation in the `application/application_constants.go` file for details.
35- PortAnnotationPrefix = "nginxinc.io"
36-
37- // ServiceAnnotationMatchKey is the key name of the annotation in the application's config map
38- // that identifies the ingress service whose events will be monitored.
18+ // ServiceAnnotationMatchKey is the key name of the annotation that
19+ // identifies the services whose events will be monitored.
3920 ServiceAnnotationMatchKey = "service-annotation-match"
4021
41- // DefaultServiceAnnotation is the default name of the ingress service whose events will be
22+ // DefaultServiceAnnotation is the default name of the services whose events will be
4223 // monitored.
4324 DefaultServiceAnnotation = "nginxaas"
4425)
4526
46- // WorkQueueSettings contains the configuration values needed by the Work Queues.
47- // There are two work queues in the application:
48- // 1. nlk-handler queue, used to move messages between the Watcher and the Handler.
49- // 2. nlk-synchronizer queue, used to move message between the Handler and the Synchronizer.
27+ // WorkQueueSettings contains the configuration for the nlk-synchronizer queue.
5028// The queues are NamedDelayingQueue objects that use an ItemExponentialFailureRateLimiter
5129// as the underlying rate limiter.
5230type WorkQueueSettings struct {
@@ -61,18 +39,6 @@ type WorkQueueSettings struct {
6139 RateLimiterMax time.Duration
6240}
6341
64- // HandlerSettings contains the configuration values needed by the Handler.
65- type HandlerSettings struct {
66- // RetryCount is the number of times the Handler will attempt to process a message before giving up.
67- RetryCount int
68-
69- // Threads is the number of threads that will be used to process messages.
70- Threads int
71-
72- // WorkQueueSettings is the configuration for the Handler's queue.
73- WorkQueueSettings WorkQueueSettings
74- }
75-
7642// WatcherSettings contains the configuration values needed by the Watcher.
7743type WatcherSettings struct {
7844 // ServiceAnnotation is the annotation of the ingress service whose events the watcher should monitor.
@@ -84,15 +50,6 @@ type WatcherSettings struct {
8450
8551// SynchronizerSettings contains the configuration values needed by the Synchronizer.
8652type SynchronizerSettings struct {
87- // MaxMillisecondsJitter is the maximum number of milliseconds that will be applied when adding an event to the queue.
88- MaxMillisecondsJitter int
89-
90- // MinMillisecondsJitter is the minimum number of milliseconds that will be applied when adding an event to the queue.
91- MinMillisecondsJitter int
92-
93- // RetryCount is the number of times the Synchronizer will attempt to process a message before giving up.
94- RetryCount int
95-
9653 // Threads is the number of threads that will be used to process messages.
9754 Threads int
9855
@@ -114,9 +71,6 @@ type Settings struct {
11471 // APIKey is the api key used to authenticate with the dataplane API.
11572 APIKey string
11673
117- // Handler contains the configuration values needed by the Handler.
118- Handler HandlerSettings
119-
12074 // Synchronizer contains the configuration values needed by the Synchronizer.
12175 Synchronizer SynchronizerSettings
12276
@@ -157,20 +111,8 @@ func Read(configName, configPath string) (s Settings, err error) {
157111 NginxPlusHosts : v .GetStringSlice ("nginx-hosts" ),
158112 SkipVerifyTLS : skipVerifyTLS ,
159113 APIKey : base64 .StdEncoding .EncodeToString ([]byte (v .GetString ("NGINXAAS_DATAPLANE_API_KEY" ))),
160- Handler : HandlerSettings {
161- RetryCount : 5 ,
162- Threads : 1 ,
163- WorkQueueSettings : WorkQueueSettings {
164- RateLimiterBase : time .Second * 2 ,
165- RateLimiterMax : time .Second * 60 ,
166- Name : "nlk-handler" ,
167- },
168- },
169114 Synchronizer : SynchronizerSettings {
170- MaxMillisecondsJitter : 750 ,
171- MinMillisecondsJitter : 250 ,
172- RetryCount : 5 ,
173- Threads : 1 ,
115+ Threads : 1 ,
174116 WorkQueueSettings : WorkQueueSettings {
175117 RateLimiterBase : time .Second * 2 ,
176118 RateLimiterMax : time .Second * 60 ,
0 commit comments