59
59
// "workload-low" is used by those workloads with lower priority which availability only has a
60
60
// minor impact on the cluster.
61
61
SuggestedPriorityLevelConfigurationWorkloadLow ,
62
+ // "global-default" serves the rest traffic not handled by the other suggested flow-schemas above.
63
+ SuggestedPriorityLevelConfigurationGlobalDefault ,
62
64
}
63
65
SuggestedFlowSchemas = []* flowcontrol.FlowSchema {
64
66
SuggestedFlowSchemaSystemNodes , // references "system" priority-level
68
70
SuggestedFlowSchemaKubeScheduler , // references "workload-high" priority-level
69
71
SuggestedFlowSchemaKubeSystemServiceAccounts , // references "workload-high" priority-level
70
72
SuggestedFlowSchemaServiceAccounts , // references "workload-low" priority-level
73
+ SuggestedFlowSchemaGlobalDefault , // references "global-default" priority-level
71
74
}
72
75
)
73
76
@@ -84,22 +87,18 @@ var (
84
87
flowcontrol.PriorityLevelConfigurationSpec {
85
88
Type : flowcontrol .PriorityLevelEnablementLimited ,
86
89
Limited : & flowcontrol.LimitedPriorityLevelConfiguration {
87
- AssuredConcurrencyShares : 100 ,
90
+ AssuredConcurrencyShares : 1 ,
88
91
LimitResponse : flowcontrol.LimitResponse {
89
- Type : flowcontrol .LimitResponseTypeQueue ,
90
- Queuing : & flowcontrol.QueuingConfiguration {
91
- Queues : 128 ,
92
- HandSize : 6 ,
93
- QueueLengthLimit : 100 ,
94
- },
92
+ Type : flowcontrol .LimitResponseTypeReject ,
95
93
},
96
94
},
97
95
})
98
96
)
99
97
100
98
// Mandatory FlowSchema objects
101
99
var (
102
- // exempt priority-level
100
+ // "exempt" priority-level is used for preventing priority inversion and ensuring that sysadmin
101
+ // requests are always possible.
103
102
MandatoryFlowSchemaExempt = newFlowSchema (
104
103
"exempt" ,
105
104
flowcontrol .PriorityLevelConfigurationNameExempt ,
@@ -124,7 +123,8 @@ var (
124
123
},
125
124
},
126
125
)
127
- // catch-all priority-level
126
+ // "catch-all" priority-level only gets a minimal positive share of concurrency and won't be reaching
127
+ // ideally unless you intentionally deleted the suggested "global-default".
128
128
MandatoryFlowSchemaCatchAll = newFlowSchema (
129
129
"catch-all" ,
130
130
"catch-all" ,
@@ -165,7 +165,7 @@ var (
165
165
Queuing : & flowcontrol.QueuingConfiguration {
166
166
Queues : 64 ,
167
167
HandSize : 6 ,
168
- QueueLengthLimit : 1000 ,
168
+ QueueLengthLimit : 50 ,
169
169
},
170
170
},
171
171
},
@@ -182,7 +182,7 @@ var (
182
182
Queuing : & flowcontrol.QueuingConfiguration {
183
183
Queues : 16 ,
184
184
HandSize : 4 ,
185
- QueueLengthLimit : 100 ,
185
+ QueueLengthLimit : 50 ,
186
186
},
187
187
},
188
188
},
@@ -199,7 +199,7 @@ var (
199
199
Queuing : & flowcontrol.QueuingConfiguration {
200
200
Queues : 128 ,
201
201
HandSize : 6 ,
202
- QueueLengthLimit : 100 ,
202
+ QueueLengthLimit : 50 ,
203
203
},
204
204
},
205
205
},
@@ -216,7 +216,24 @@ var (
216
216
Queuing : & flowcontrol.QueuingConfiguration {
217
217
Queues : 128 ,
218
218
HandSize : 6 ,
219
- QueueLengthLimit : 100 ,
219
+ QueueLengthLimit : 50 ,
220
+ },
221
+ },
222
+ },
223
+ })
224
+ // global-default priority-level
225
+ SuggestedPriorityLevelConfigurationGlobalDefault = newPriorityLevelConfiguration (
226
+ "global-default" ,
227
+ flowcontrol.PriorityLevelConfigurationSpec {
228
+ Type : flowcontrol .PriorityLevelEnablementLimited ,
229
+ Limited : & flowcontrol.LimitedPriorityLevelConfiguration {
230
+ AssuredConcurrencyShares : 100 ,
231
+ LimitResponse : flowcontrol.LimitResponse {
232
+ Type : flowcontrol .LimitResponseTypeQueue ,
233
+ Queuing : & flowcontrol.QueuingConfiguration {
234
+ Queues : 128 ,
235
+ HandSize : 6 ,
236
+ QueueLengthLimit : 50 ,
220
237
},
221
238
},
222
239
},
@@ -359,6 +376,24 @@ var (
359
376
},
360
377
},
361
378
)
379
+ SuggestedFlowSchemaGlobalDefault = newFlowSchema (
380
+ "global-default" , "global-default" , 9900 ,
381
+ flowcontrol .FlowDistinguisherMethodByUserType ,
382
+ flowcontrol.PolicyRulesWithSubjects {
383
+ Subjects : groups (serviceaccount .AllServiceAccountsGroup ),
384
+ ResourceRules : []flowcontrol.ResourcePolicyRule {resourceRule (
385
+ []string {flowcontrol .VerbAll },
386
+ []string {flowcontrol .APIGroupAll },
387
+ []string {flowcontrol .ResourceAll },
388
+ []string {flowcontrol .NamespaceEvery },
389
+ true )},
390
+ NonResourceRules : []flowcontrol.NonResourcePolicyRule {
391
+ nonResourceRule (
392
+ []string {flowcontrol .VerbAll },
393
+ []string {flowcontrol .NonResourceAll }),
394
+ },
395
+ },
396
+ )
362
397
)
363
398
364
399
func newPriorityLevelConfiguration (name string , spec flowcontrol.PriorityLevelConfigurationSpec ) * flowcontrol.PriorityLevelConfiguration {
0 commit comments