Skip to content

Commit

Permalink
Add spec documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ole Markus With committed Aug 21, 2020
1 parent c154872 commit b6184c1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
1 change: 1 addition & 0 deletions pkg/apis/kops/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ type ClusterSpec struct {
// RollingUpdate defines the default rolling-update settings for instance groups
RollingUpdate *RollingUpdate `json:"rollingUpdate,omitempty"`

// ClusterAutoscaler defines the cluaster autoscaler configuration
ClusterAutoscaler *ClusterAutoscalerConfig `json:"clusterAutoscaler,omitempty"`
}

Expand Down
20 changes: 16 additions & 4 deletions pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,12 +755,24 @@ type CloudConfiguration struct {
Openstack *OpenstackConfiguration `json:"openstack,omitempty"`
}

// ClusterAutoscalerConfig determines the cluster autoscaler configuration
type ClusterAutoscalerConfig struct {
Expander *string `json:"expander,omitempty"`
BalanceSimilarNodeGroups *bool `json:"balanceSimilarNodeGroups,omitempty"`
// Expander determines the strategy for which instance group gets expanded
// Supported values: least-waste, most-pods, random
// Default: least-waste
Expander *string `json:"expander,omitempty"`
// BalanceSimilarNodeGroups makes cluster autoscaler treat similar node groups as one
// Default: false
BalanceSimilarNodeGroups *bool `json:"balanceSimilarNodeGroups,omitempty"`
// ScaleDownUtilizationThreshold determines the utilization threshold for node scale-down
// Default: 0.5
ScaleDownUtilizationThreshold *string `json:"scaleDownUtilizationThreshold,omitempty"`
SkipNodesWithSystemPods *bool `json:"skipNodesWithSystemPods,omitempty"`
SkipNodesWithLocalStorage *bool `json:"skipNodesWithLocalStorage,omitempty"`
// SkipNodesWithSystemPods makes cluster autoscaler skip scale-down of nodes with system pods
// Default: true
SkipNodesWithSystemPods *bool `json:"skipNodesWithSystemPods,omitempty"`
// SkipNodesWithLocalStorage makes cluster autoscaler skip scale-down of nodes with local storage
// Default: true
SkipNodesWithLocalStorage *bool `json:"skipNodesWithLocalStorage,omitempty"`
}

// HasAdmissionController checks if a specific admission controller is enabled
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/kops/v1alpha2/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ type ClusterSpec struct {
// RollingUpdate defines the default rolling-update settings for instance groups
RollingUpdate *RollingUpdate `json:"rollingUpdate,omitempty"`

// ClusterAutoscaler defines the cluaster autoscaler configuration
ClusterAutoscaler *ClusterAutoscalerConfig `json:"clusterAutoscaler,omitempty"`
}

Expand Down
20 changes: 16 additions & 4 deletions pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,12 +756,24 @@ type CloudConfiguration struct {
Openstack *OpenstackConfiguration `json:"openstack,omitempty"`
}

// ClusterAutoscalerConfig determines the cluster autoscaler configuration
type ClusterAutoscalerConfig struct {
Expander *string `json:"expander,omitempty"`
BalanceSimilarNodeGroups *bool `json:"balanceSimilarNodeGroups,omitempty"`
// Expander determines the strategy for which instance group gets expanded
// Supported values: least-waste, most-pods, random
// Default: least-waste
Expander *string `json:"expander,omitempty"`
// BalanceSimilarNodeGroups makes cluster autoscaler treat similar node groups as one
// Default: false
BalanceSimilarNodeGroups *bool `json:"balanceSimilarNodeGroups,omitempty"`
// ScaleDownUtilizationThreshold determines the utilization threshold for node scale-down
// Default: 0.5
ScaleDownUtilizationThreshold *string `json:"scaleDownUtilizationThreshold,omitempty"`
SkipNodesWithSystemPods *bool `json:"skipNodesWithSystemPods,omitempty"`
SkipNodesWithLocalStorage *bool `json:"skipNodesWithLocalStorage,omitempty"`
// SkipNodesWithSystemPods makes cluster autoscaler skip scale-down of nodes with system pods
// Default: true
SkipNodesWithSystemPods *bool `json:"skipNodesWithSystemPods,omitempty"`
// SkipNodesWithLocalStorage makes cluster autoscaler skip scale-down of nodes with local storage
// Default: true
SkipNodesWithLocalStorage *bool `json:"skipNodesWithLocalStorage,omitempty"`
}

// HasAdmissionController checks if a specific admission controller is enabled
Expand Down

0 comments on commit b6184c1

Please sign in to comment.