Skip to content

Commit 048a3ef

Browse files
author
Kubernetes Submit Queue
authoredNov 28, 2017
Merge pull request #3939 from itskingori/add_hpa_use_clients_flag
Automatic merge from submit-queue. Map horizontal-pod-autoscaler-use-rest-clients flag Maps `--horizontal-pod-autoscaler-use-rest-clients` flag which is required for [Horizontal Pod Autoscaling][1]. See Kubernetes code in [kubernetes/kubernetes/blob/v1.7.11/cmd/kube-controller-manager/app/autoscaling.go#L36-L39][2]. Seems this is the missing piece for fulfilment of HPA pre-requisites, which are: * ✅ Enable the [Aggregation Layer][4] via the following kube-apiserver flags * ✅ `--requestheader-client-ca-file=<path to aggregator CA cert>` (see #3679) * ✅ `--requestheader-allowed-names=aggregator` (see #3679) * ✅ `--requestheader-extra-headers-prefix=X-Remote-Extra-` (see #3679) * ✅ `--requestheader-group-headers=X-Remote-Group` (see #3679) * ✅ `--requestheader-username-headers=X-Remote-User` (see #3679) * ✅ `--proxy-client-cert-file=<path to aggregator proxy cert>` (see #3165) * ✅ `--proxy-client-key-file=<path to aggregator proxy key>` (see #3165) * ❓ [Horizontal Pod Scaling][3] ... set the appropriate flags for `kube-controller-manager`: * ❎ `--horizontal-pod-autoscaler-use-rest-clients` should be `true`. * ✅ `--kubeconfig <path-to-kubeconfig>` (already set) **Relevant Documentation:** * https://v1-7.docs.kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ * https://v1-7.docs.kubernetes.io/docs/tasks/access-kubernetes-api/configure-aggregation-layer/ **Relevant Issues & PRs:** * #3679 * #3152 * #2691 * #2652 * #3165 [1]: https://v1-7.docs.kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ [2]: https://github.com/kubernetes/kubernetes/blob/v1.7.11/cmd/kube-controller-manager/app/autoscaling.go#L36-L39 [3]: https://v1-7.docs.kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ [4]: https://v1-7.docs.kubernetes.io/docs/tasks/access-kubernetes-api/configure-aggregation-layer/
2 parents 967ed4a + 28ff1bf commit 048a3ef

8 files changed

+40
-0
lines changed
 

‎pkg/apis/kops/componentconfig.go

+3
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ type KubeControllerManagerConfig struct {
323323
// long the autoscaler has to wait before another upscale operation can
324324
// be performed after the current one has completed.
325325
HorizontalPodAutoscalerUpscaleDelay *metav1.Duration `json:"horizontalPodAutoscalerUpscaleDelay,omitempty" flag:"horizontal-pod-autoscaler-upscale-delay"`
326+
// HorizontalPodAutoscalerUseRestClients determines if the new-style clients
327+
// should be used if support for custom metrics is enabled.
328+
HorizontalPodAutoscalerUseRestClients *bool `json:"horizontalPodAutoscalerUseRestClients,omitempty" flag:"horizontal-pod-autoscaler-use-rest-clients"`
326329
// FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features.
327330
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"`
328331
}

‎pkg/apis/kops/v1alpha1/componentconfig.go

+3
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ type KubeControllerManagerConfig struct {
323323
// long the autoscaler has to wait before another upscale operation can
324324
// be performed after the current one has completed.
325325
HorizontalPodAutoscalerUpscaleDelay *metav1.Duration `json:"horizontalPodAutoscalerUpscaleDelay,omitempty" flag:"horizontal-pod-autoscaler-upscale-delay"`
326+
// HorizontalPodAutoscalerUseRestClients determines if the new-style clients
327+
// should be used if support for custom metrics is enabled.
328+
HorizontalPodAutoscalerUseRestClients *bool `json:"horizontalPodAutoscalerUseRestClients,omitempty" flag:"horizontal-pod-autoscaler-use-rest-clients"`
326329
// FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features.
327330
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"`
328331
}

‎pkg/apis/kops/v1alpha1/zz_generated.conversion.go

+2
Original file line numberDiff line numberDiff line change
@@ -1944,6 +1944,7 @@ func autoConvert_v1alpha1_KubeControllerManagerConfig_To_kops_KubeControllerMana
19441944
out.HorizontalPodAutoscalerSyncPeriod = in.HorizontalPodAutoscalerSyncPeriod
19451945
out.HorizontalPodAutoscalerDownscaleDelay = in.HorizontalPodAutoscalerDownscaleDelay
19461946
out.HorizontalPodAutoscalerUpscaleDelay = in.HorizontalPodAutoscalerUpscaleDelay
1947+
out.HorizontalPodAutoscalerUseRestClients = in.HorizontalPodAutoscalerUseRestClients
19471948
out.FeatureGates = in.FeatureGates
19481949
return nil
19491950
}
@@ -1979,6 +1980,7 @@ func autoConvert_kops_KubeControllerManagerConfig_To_v1alpha1_KubeControllerMana
19791980
out.HorizontalPodAutoscalerSyncPeriod = in.HorizontalPodAutoscalerSyncPeriod
19801981
out.HorizontalPodAutoscalerDownscaleDelay = in.HorizontalPodAutoscalerDownscaleDelay
19811982
out.HorizontalPodAutoscalerUpscaleDelay = in.HorizontalPodAutoscalerUpscaleDelay
1983+
out.HorizontalPodAutoscalerUseRestClients = in.HorizontalPodAutoscalerUseRestClients
19821984
out.FeatureGates = in.FeatureGates
19831985
return nil
19841986
}

‎pkg/apis/kops/v1alpha1/zz_generated.deepcopy.go

+9
Original file line numberDiff line numberDiff line change
@@ -2173,6 +2173,15 @@ func (in *KubeControllerManagerConfig) DeepCopyInto(out *KubeControllerManagerCo
21732173
**out = **in
21742174
}
21752175
}
2176+
if in.HorizontalPodAutoscalerUseRestClients != nil {
2177+
in, out := &in.HorizontalPodAutoscalerUseRestClients, &out.HorizontalPodAutoscalerUseRestClients
2178+
if *in == nil {
2179+
*out = nil
2180+
} else {
2181+
*out = new(bool)
2182+
**out = **in
2183+
}
2184+
}
21762185
if in.FeatureGates != nil {
21772186
in, out := &in.FeatureGates, &out.FeatureGates
21782187
*out = make(map[string]string, len(*in))

‎pkg/apis/kops/v1alpha2/componentconfig.go

+3
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ type KubeControllerManagerConfig struct {
323323
// long the autoscaler has to wait before another upscale operation can
324324
// be performed after the current one has completed.
325325
HorizontalPodAutoscalerUpscaleDelay *metav1.Duration `json:"horizontalPodAutoscalerUpscaleDelay,omitempty" flag:"horizontal-pod-autoscaler-upscale-delay"`
326+
// HorizontalPodAutoscalerUseRestClients determines if the new-style clients
327+
// should be used if support for custom metrics is enabled.
328+
HorizontalPodAutoscalerUseRestClients *bool `json:"horizontalPodAutoscalerUseRestClients,omitempty" flag:"horizontal-pod-autoscaler-use-rest-clients"`
326329
// FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features.
327330
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"`
328331
}

‎pkg/apis/kops/v1alpha2/zz_generated.conversion.go

+2
Original file line numberDiff line numberDiff line change
@@ -2206,6 +2206,7 @@ func autoConvert_v1alpha2_KubeControllerManagerConfig_To_kops_KubeControllerMana
22062206
out.HorizontalPodAutoscalerSyncPeriod = in.HorizontalPodAutoscalerSyncPeriod
22072207
out.HorizontalPodAutoscalerDownscaleDelay = in.HorizontalPodAutoscalerDownscaleDelay
22082208
out.HorizontalPodAutoscalerUpscaleDelay = in.HorizontalPodAutoscalerUpscaleDelay
2209+
out.HorizontalPodAutoscalerUseRestClients = in.HorizontalPodAutoscalerUseRestClients
22092210
out.FeatureGates = in.FeatureGates
22102211
return nil
22112212
}
@@ -2241,6 +2242,7 @@ func autoConvert_kops_KubeControllerManagerConfig_To_v1alpha2_KubeControllerMana
22412242
out.HorizontalPodAutoscalerSyncPeriod = in.HorizontalPodAutoscalerSyncPeriod
22422243
out.HorizontalPodAutoscalerDownscaleDelay = in.HorizontalPodAutoscalerDownscaleDelay
22432244
out.HorizontalPodAutoscalerUpscaleDelay = in.HorizontalPodAutoscalerUpscaleDelay
2245+
out.HorizontalPodAutoscalerUseRestClients = in.HorizontalPodAutoscalerUseRestClients
22442246
out.FeatureGates = in.FeatureGates
22452247
return nil
22462248
}

‎pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

+9
Original file line numberDiff line numberDiff line change
@@ -2299,6 +2299,15 @@ func (in *KubeControllerManagerConfig) DeepCopyInto(out *KubeControllerManagerCo
22992299
**out = **in
23002300
}
23012301
}
2302+
if in.HorizontalPodAutoscalerUseRestClients != nil {
2303+
in, out := &in.HorizontalPodAutoscalerUseRestClients, &out.HorizontalPodAutoscalerUseRestClients
2304+
if *in == nil {
2305+
*out = nil
2306+
} else {
2307+
*out = new(bool)
2308+
**out = **in
2309+
}
2310+
}
23022311
if in.FeatureGates != nil {
23032312
in, out := &in.FeatureGates, &out.FeatureGates
23042313
*out = make(map[string]string, len(*in))

‎pkg/apis/kops/zz_generated.deepcopy.go

+9
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,15 @@ func (in *KubeControllerManagerConfig) DeepCopyInto(out *KubeControllerManagerCo
25182518
**out = **in
25192519
}
25202520
}
2521+
if in.HorizontalPodAutoscalerUseRestClients != nil {
2522+
in, out := &in.HorizontalPodAutoscalerUseRestClients, &out.HorizontalPodAutoscalerUseRestClients
2523+
if *in == nil {
2524+
*out = nil
2525+
} else {
2526+
*out = new(bool)
2527+
**out = **in
2528+
}
2529+
}
25212530
if in.FeatureGates != nil {
25222531
in, out := &in.FeatureGates, &out.FeatureGates
25232532
*out = make(map[string]string, len(*in))

0 commit comments

Comments
 (0)
Please sign in to comment.