@@ -11,7 +11,7 @@ approvers:
11
11
- " @josephburnett"
12
12
- " @gjtempleton"
13
13
creation-date : 2020-02-18
14
- last-updated : 2020-06 -03
14
+ last-updated : 2020-11 -03
15
15
status : implementable
16
16
---
17
17
@@ -77,7 +77,6 @@ a way to specify the target usage in a more fine grained manner.
77
77
### Goals
78
78
79
79
- Make HPA scale based on individual container resources usage
80
- - Alias the resource metric source to pod resource metric source.
81
80
82
81
### Non-Goals
83
82
- Configurable aggregation for containers resources in pods.
@@ -115,10 +114,8 @@ of the `application` container might be affected significantly. There is no way
115
114
in the HPA to keep the utilization of the first container below a certain threshold. This also
116
115
affects ` memory ` resource based autocaling scaling.
117
116
118
- We propose that the following changes be made to the metric sources to address this problem:
119
-
120
- 1 . A new metric source called ` ContainerResourceMetricSource ` be introduced with the following
121
- structure:
117
+ We propose that the a new metric source called ` ContainerResourceMetricSource ` be introduced
118
+ with the following structure:
122
119
123
120
``` go
124
121
type ContainerResourceMetricSource struct {
@@ -131,11 +128,6 @@ type ContainerResourceMetricSource struct {
131
128
The only new field is ` Container ` which is the name of the container for which the resource
132
129
usage should be tracked.
133
130
134
- 2 . The ` ResourceMetricSource ` should be aliased to ` PodResourceMetricSource ` . It will work
135
- exactly as the original. The aliasing is done for the sake of consistency. Correspondingly,
136
- the ` type ` field for the metric source should be extended to support both ` ContainerResource `
137
- and ` PodResource ` as values.
138
-
139
131
### User Stories
140
132
141
133
#### Multiple containers with different scaling thresholds
@@ -283,10 +275,14 @@ above the target.
283
275
284
276
# ## Risks and Mitigations
285
277
286
- In order to keep backward compatibility with the existing API both `ResourceMetricSource` and
287
- ` PodResourceMetricSource` will be supported. Existing HPAs will continue functioning like before.
288
- There will be no deprecation warning or internal migrations from `ResourceMetricSource` to
289
- ` PodResourceMetricSource` .
278
+ Since the new field `container` in the container resource metric source is not validated against the target it is
279
+ possible that the user could specify an invalid value, i.e. a container name which is not part of the pod. The HPA
280
+ controller would treat this as invalid configuration and prevent scale down. However scale up would still be possible
281
+ based on recommendations from other metric sources.
282
+
283
+ A similar problem is possible when renaming container names in the HPA. To mitigate this the recommended procedure
284
+ is to have both the old and new container names during the deployment. The old container name can be removed from
285
+ the HPA when the migration is complete.
290
286
291
287
292
288
# # Design Details
@@ -312,8 +308,9 @@ criteria required because it will graduate when the original API graduates to `s
312
308
For cluster upgrades the HPAs from the previous version will continue working as before. There
313
309
is no change in behavior or flags which have to be enabled or disabled.
314
310
315
- For clusters which have HPAs which use `ContainerResourceMetricSource` or `PodResourceMetricSource`
316
- a downgrade is possible after HPAs which use this new source have been modified to use
317
- ` ResourceMetricSource` instead.
311
+ A new feature gate `HPAContainerMetrics` is added in version 1.20 which is turned off by default.
312
+ The new feature can only be used when this feature gate is enabled.
318
313
319
314
# # Implementation History
315
+ * 2020-04-03 Initial KEP merged
316
+ * 2020-10-23 Implementation merged
0 commit comments