Skip to content

Commit

Permalink
Merge pull request #3673 from mikesplain/HorizontalPodAutoscalerSyncP…
Browse files Browse the repository at this point in the history
…eriod

Automatic merge from submit-queue.

Add HorizontalPodAutoscalerSyncPeriod for kubeControllerManager

Adds an option to set `--horizontal-pod-autoscaler-sync-period`.  [More details.](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/)
  • Loading branch information
Kubernetes Submit Queue authored Oct 19, 2017
2 parents 429f750 + 8549e8e commit 0ef245b
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 2 deletions.
11 changes: 11 additions & 0 deletions docs/cluster_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,17 @@ Will resulting to running kube-scheduler with the arguments `--policy-configmap=

Note that as of Kubernetes 1.8.0 kube-scheduler does not reload its configuration from configmap automatically. You will need to ssh into the master instance and restart the Docker container manually. Also, this option is not supported during cluster creation, only during updates.

### kubeControllerManager
This block contains configurations for the `controller-manager`.

```yaml
spec:
kubeControllerManager:
horizontalPodAutoscalerSyncPeriod: 15s
```
For more details on `horizontalPodAutoscalerSyncPeriod` see the [HPA docs](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/)

#### Feature Gates

```yaml
Expand Down
6 changes: 5 additions & 1 deletion pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ type KubeProxyConfig struct {

// KubeAPIServerConfig defines the configuration for the kube api
type KubeAPIServerConfig struct {
// Image is the docker container used
// Image is the docker container usedrun
Image string `json:"image,omitempty"`
// LogLevel is the logging level of the api
LogLevel int32 `json:"logLevel,omitempty" flag:"v" flag-empty:"0"`
Expand Down Expand Up @@ -294,6 +294,10 @@ type KubeControllerManagerConfig struct {
TerminatedPodGCThreshold *int32 `json:"terminatedPodGCThreshold,omitempty" flag:"terminated-pod-gc-threshold"`
// UseServiceAccountCredentials controls whether we use individual service account credentials for each controller.
UseServiceAccountCredentials *bool `json:"useServiceAccountCredentials,omitempty" flag:"use-service-account-credentials"`
// HorizontalPodAutoscalerSyncPeriod is the amount of time between syncs
// During each period, the controller manager queries the resource utilization
// against the metrics specified in each HorizontalPodAutoscaler definition
HorizontalPodAutoscalerSyncPeriod *metav1.Duration `json:"horizontalPodAutoscalerSyncPeriod,omitempty" flag:"horizontal-pod-autoscaler-sync-period"`
}

type CloudControllerManagerConfig struct {
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/kops/v1alpha1/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ type KubeControllerManagerConfig struct {
TerminatedPodGCThreshold *int32 `json:"terminatedPodGCThreshold,omitempty" flag:"terminated-pod-gc-threshold"`
// UseServiceAccountCredentials controls whether we use individual service account credentials for each controller.
UseServiceAccountCredentials *bool `json:"useServiceAccountCredentials,omitempty" flag:"use-service-account-credentials"`
// HorizontalPodAutoscalerSyncPeriod is the amount of time between syncs
// During each period, the controller manager queries the resource utilization
// against the metrics specified in each HorizontalPodAutoscaler definition
HorizontalPodAutoscalerSyncPeriod *metav1.Duration `json:"horizontalPodAutoscalerSyncPeriod,omitempty" flag:"horizontal-pod-autoscaler-sync-period"`
}

type CloudControllerManagerConfig struct {
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha1/zz_generated.conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -1893,6 +1893,7 @@ func autoConvert_v1alpha1_KubeControllerManagerConfig_To_kops_KubeControllerMana
out.AttachDetachReconcileSyncPeriod = in.AttachDetachReconcileSyncPeriod
out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold
out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
out.HorizontalPodAutoscalerSyncPeriod = in.HorizontalPodAutoscalerSyncPeriod
return nil
}

Expand Down Expand Up @@ -1924,6 +1925,7 @@ func autoConvert_kops_KubeControllerManagerConfig_To_v1alpha1_KubeControllerMana
out.AttachDetachReconcileSyncPeriod = in.AttachDetachReconcileSyncPeriod
out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold
out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
out.HorizontalPodAutoscalerSyncPeriod = in.HorizontalPodAutoscalerSyncPeriod
return nil
}

Expand Down
9 changes: 9 additions & 0 deletions pkg/apis/kops/v1alpha1/zz_generated.deepcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2087,6 +2087,15 @@ func (in *KubeControllerManagerConfig) DeepCopyInto(out *KubeControllerManagerCo
**out = **in
}
}
if in.HorizontalPodAutoscalerSyncPeriod != nil {
in, out := &in.HorizontalPodAutoscalerSyncPeriod, &out.HorizontalPodAutoscalerSyncPeriod
if *in == nil {
*out = nil
} else {
*out = new(v1.Duration)
**out = **in
}
}
return
}

Expand Down
5 changes: 4 additions & 1 deletion pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,12 @@ type KubeControllerManagerConfig struct {
// before the terminated pod garbage collector starts deleting terminated pods.
// If <= 0, the terminated pod garbage collector is disabled.
TerminatedPodGCThreshold *int32 `json:"terminatedPodGCThreshold,omitempty" flag:"terminated-pod-gc-threshold"`

// UseServiceAccountCredentials controls whether we use individual service account credentials for each controller.
UseServiceAccountCredentials *bool `json:"useServiceAccountCredentials,omitempty" flag:"use-service-account-credentials"`
// HorizontalPodAutoscalerSyncPeriod is the amount of time between syncs
// During each period, the controller manager queries the resource utilization
// against the metrics specified in each HorizontalPodAutoscaler definition
HorizontalPodAutoscalerSyncPeriod *metav1.Duration `json:"horizontalPodAutoscalerSyncPeriod,omitempty" flag:"horizontal-pod-autoscaler-sync-period"`
}

type CloudControllerManagerConfig struct {
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,7 @@ func autoConvert_v1alpha2_KubeControllerManagerConfig_To_kops_KubeControllerMana
out.AttachDetachReconcileSyncPeriod = in.AttachDetachReconcileSyncPeriod
out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold
out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
out.HorizontalPodAutoscalerSyncPeriod = in.HorizontalPodAutoscalerSyncPeriod
return nil
}

Expand Down Expand Up @@ -2186,6 +2187,7 @@ func autoConvert_kops_KubeControllerManagerConfig_To_v1alpha2_KubeControllerMana
out.AttachDetachReconcileSyncPeriod = in.AttachDetachReconcileSyncPeriod
out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold
out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
out.HorizontalPodAutoscalerSyncPeriod = in.HorizontalPodAutoscalerSyncPeriod
return nil
}

Expand Down
9 changes: 9 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2213,6 +2213,15 @@ func (in *KubeControllerManagerConfig) DeepCopyInto(out *KubeControllerManagerCo
**out = **in
}
}
if in.HorizontalPodAutoscalerSyncPeriod != nil {
in, out := &in.HorizontalPodAutoscalerSyncPeriod, &out.HorizontalPodAutoscalerSyncPeriod
if *in == nil {
*out = nil
} else {
*out = new(v1.Duration)
**out = **in
}
}
return
}

Expand Down
9 changes: 9 additions & 0 deletions pkg/apis/kops/zz_generated.deepcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,15 @@ func (in *KubeControllerManagerConfig) DeepCopyInto(out *KubeControllerManagerCo
**out = **in
}
}
if in.HorizontalPodAutoscalerSyncPeriod != nil {
in, out := &in.HorizontalPodAutoscalerSyncPeriod, &out.HorizontalPodAutoscalerSyncPeriod
if *in == nil {
*out = nil
} else {
*out = new(v1.Duration)
**out = **in
}
}
return
}

Expand Down

0 comments on commit 0ef245b

Please sign in to comment.