Skip to content

Commit 69caeb7

Browse files
committed
OCM-14135 | feat: Change help messages for autoscaler cmds
1 parent 2ebebd5 commit 69caeb7

File tree

5 files changed

+44
-30
lines changed

5 files changed

+44
-30
lines changed

cmd/create/autoscaler/cmd.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ const (
3333
argsPrefix = ""
3434
use = "autoscaler"
3535
short = "Create an autoscaler for a cluster"
36-
long = "Configuring cluster-wide autoscaling behavior. At least one machine-pool should " +
37-
"have autoscaling enabled for the configuration to be active"
36+
long = " Configuring cluster-wide autoscaling behavior. At least one machine-pool should have autoscaling " +
37+
"enabled for the configuration to be active. Supported only on ROSA clusters with self-hosted Control Plane " +
38+
"(Classic)"
3839
example = ` # Interactively create an autoscaler to a cluster named "mycluster"
3940
rosa create autoscaler --cluster=mycluster --interactive
4041

cmd/describe/autoscaler/cmd.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ import (
1313
)
1414

1515
const (
16-
use = "autoscaler"
17-
short = "Show details of the autoscaler for a cluster"
18-
long = short
16+
use = "autoscaler"
17+
short = "Show details of the autoscaler for a cluster"
18+
long = "Describes the configuration for cluster's Cluster Auto-scaler. Supported on ROSA clusters " +
19+
"service-hosted (HCP) with self-hosted (Classic) control planes."
1920
example = ` # Describe the autoscaler for cluster 'foo'
2021
rosa describe autoscaler --cluster foo`
2122
)

cmd/dlt/autoscaler/cmd.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ import (
2828
)
2929

3030
const (
31-
use = "autoscaler"
32-
short = "Delete autoscaler for cluster"
33-
long = "Delete autoscaler configuration for a given cluster."
31+
use = "autoscaler"
32+
short = "Delete autoscaler for cluster"
33+
long = "Delete autoscaler configuration for a given cluster. " +
34+
"Supported only on ROSA clusters with self-hosted Control Plane (Classic)"
3435
example = ` # Delete the autoscaler config for cluster named "mycluster"
3536
rosa delete autoscaler --cluster=mycluster`
3637
)

cmd/edit/autoscaler/cmd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ const (
3333
argsPrefix = ""
3434
use = "autoscaler"
3535
short = "Edit the autoscaler of a cluster"
36-
long = "Configuring cluster-wide autoscaling behavior. At least one machine-pool should " +
37-
"have autoscaling enabled for the configuration to be active"
36+
long = " Updates the configuration for cluster's Cluster Auto-scaler. Supported on ROSA clusters " +
37+
"service-hosted (HCP) with self-hosted (Classic) control planes."
3838
example = ` # Interactively edit an autoscaler to a cluster named "mycluster"
3939
rosa edit autoscaler --cluster=mycluster --interactive
4040

pkg/clusterautoscaler/flags.go

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ const (
3636
scaleDownDelayAfterAddFlag = "scale-down-delay-after-add"
3737
scaleDownDelayAfterDeleteFlag = "scale-down-delay-after-delete"
3838
scaleDownDelayAfterFailureFlag = "scale-down-delay-after-failure"
39+
40+
classicOnlyHelpMsg = "Only supported for self-hosted (Classic) control plane clusters."
3941
)
4042

4143
type AutoscalerArgs struct {
@@ -100,22 +102,24 @@ func AddClusterAutoscalerFlags(cmd *cobra.Command, prefix string) *AutoscalerArg
100102
&args.BalanceSimilarNodeGroups,
101103
fmt.Sprintf("%s%s", prefix, balanceSimilarNodeGroupsFlag),
102104
false,
103-
"Identify node groups with the same instance type and label set, "+
104-
"and aim to balance respective sizes of those node groups.",
105+
fmt.Sprintf("Identify node groups with the same instance type and label set, "+
106+
"and aim to balance respective sizes of those node groups. %s", classicOnlyHelpMsg),
105107
)
106108

107109
cmd.Flags().BoolVar(
108110
&args.SkipNodesWithLocalStorage,
109111
fmt.Sprintf("%s%s", prefix, skipNodesWithLocalStorageFlag),
110112
false,
111-
"If true cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath.",
113+
fmt.Sprintf("If true cluster autoscaler will never delete nodes with pods with local storage, e.g."+
114+
" EmptyDir or HostPath. %s", classicOnlyHelpMsg),
112115
)
113116

114117
cmd.Flags().IntVar(
115118
&args.LogVerbosity,
116119
fmt.Sprintf("%s%s", prefix, logVerbosityFlag),
117120
1,
118-
"Autoscaler log level. Default is 1, 4 is a good option when trying to debug the autoscaler.",
121+
fmt.Sprintf("Autoscaler log level. Default is 1, 4 is a good option when trying to debug the autoscaler."+
122+
" %s", classicOnlyHelpMsg),
119123
)
120124

121125
cmd.Flags().IntVar(
@@ -137,7 +141,8 @@ func AddClusterAutoscalerFlags(cmd *cobra.Command, prefix string) *AutoscalerArg
137141
&args.IgnoreDaemonsetsUtilization,
138142
fmt.Sprintf("%s%s", prefix, ignoreDaemonsetsUtilizationFlag),
139143
false,
140-
"Should cluster-autoscaler ignore DaemonSet pods when calculating resource utilization for scaling down.",
144+
fmt.Sprintf("Should cluster-autoscaler ignore DaemonSet pods when calculating resource utilization for "+
145+
"scaling down. %s", classicOnlyHelpMsg),
141146
)
142147

143148
cmd.Flags().StringVar(
@@ -152,7 +157,8 @@ func AddClusterAutoscalerFlags(cmd *cobra.Command, prefix string) *AutoscalerArg
152157
&args.BalancingIgnoredLabels,
153158
fmt.Sprintf("%s%s", prefix, balancingIgnoredLabelsFlag),
154159
nil,
155-
"A comma-separated list of label keys that cluster autoscaler should ignore when considering node group similarity.",
160+
fmt.Sprintf("A comma-separated list of label keys that cluster autoscaler should ignore when "+
161+
"considering node group similarity. %s", classicOnlyHelpMsg),
156162
)
157163

158164
// Resource Limits
@@ -168,14 +174,14 @@ func AddClusterAutoscalerFlags(cmd *cobra.Command, prefix string) *AutoscalerArg
168174
&args.ResourceLimits.Cores.Min,
169175
fmt.Sprintf("%s%s", prefix, minCoresFlag),
170176
0,
171-
"Minimum limit for the amount of cores to deploy in the cluster.",
177+
fmt.Sprintf("Minimum limit for the amount of cores to deploy in the cluster. %s", classicOnlyHelpMsg),
172178
)
173179

174180
cmd.Flags().IntVar(
175181
&args.ResourceLimits.Cores.Max,
176182
fmt.Sprintf("%s%s", prefix, maxCoresFlag),
177183
180*64,
178-
"Maximum limit for the amount of cores to deploy in the cluster.",
184+
fmt.Sprintf("Maximum limit for the amount of cores to deploy in the cluster. %s", classicOnlyHelpMsg),
179185
)
180186

181187
cmd.MarkFlagsRequiredTogether(
@@ -187,14 +193,14 @@ func AddClusterAutoscalerFlags(cmd *cobra.Command, prefix string) *AutoscalerArg
187193
&args.ResourceLimits.Memory.Min,
188194
fmt.Sprintf("%s%s", prefix, minMemoryFlag),
189195
0,
190-
"Minimum limit for the amount of memory, in GiB, in the cluster.",
196+
fmt.Sprintf("Minimum limit for the amount of memory, in GiB, in the cluster. %s", classicOnlyHelpMsg),
191197
)
192198

193199
cmd.Flags().IntVar(
194200
&args.ResourceLimits.Memory.Max,
195201
fmt.Sprintf("%s%s", prefix, maxMemoryFlag),
196202
180*64*20,
197-
"Maximum limit for the amount of memory, in GiB, in the cluster.",
203+
fmt.Sprintf("Maximum limit for the amount of memory, in GiB, in the cluster. %s", classicOnlyHelpMsg),
198204
)
199205

200206
cmd.MarkFlagsRequiredTogether(
@@ -211,8 +217,9 @@ func AddClusterAutoscalerFlags(cmd *cobra.Command, prefix string) *AutoscalerArg
211217
"Limit GPUs consumption. It should be comprised of 3 values separated "+
212218
"with commas: the GPU hardware type, a minimal count for that type "+
213219
"and a maximal count for that type. This option can be repeated multiple "+
214-
"times in order to apply multiple restrictions for different GPU types. For example: "+
215-
"--%[1]s nvidia.com/gpu,0,10 --%[1]s amd.com/gpu,1,5", flag),
220+
"times in order to apply multiple restrictions for different GPU types. "+
221+
"Only supported for self-hosted (Classic) control plane clusters. "+
222+
"For example: --%[1]s nvidia.com/gpu,0,10 --%[1]s amd.com/gpu,1,5", flag),
216223
)
217224

218225
// Scale down Configuration
@@ -221,44 +228,48 @@ func AddClusterAutoscalerFlags(cmd *cobra.Command, prefix string) *AutoscalerArg
221228
&args.ScaleDown.Enabled,
222229
fmt.Sprintf("%s%s", prefix, scaleDownEnabledFlag),
223230
false,
224-
"Should cluster-autoscaler be able to scale down the cluster.",
231+
fmt.Sprintf("Should cluster-autoscaler be able to scale down the cluster. %s", classicOnlyHelpMsg),
225232
)
226233

227234
cmd.Flags().StringVar(
228235
&args.ScaleDown.UnneededTime,
229236
fmt.Sprintf("%s%s", prefix, scaleDownUnneededTimeFlag),
230237
"",
231-
"Increasing value will make nodes stay up longer, waiting for pods to be scheduled "+
232-
"while decreasing value will make nodes be deleted sooner.",
238+
fmt.Sprintf("Increasing value will make nodes stay up longer, waiting for pods to be scheduled "+
239+
"while decreasing value will make nodes be deleted sooner. %s", classicOnlyHelpMsg),
233240
)
234241

235242
cmd.Flags().Float64Var(
236243
&args.ScaleDown.UtilizationThreshold,
237244
fmt.Sprintf("%s%s", prefix, scaleDownUtilizationThresholdFlag),
238245
0.5,
239-
"Node utilization level, defined as sum of requested resources divided by capacity, "+
240-
"below which a node can be considered for scale down. Value should be between 0 and 1.",
246+
fmt.Sprintf("Node utilization level, defined as sum of requested resources divided by capacity, "+
247+
"below which a node can be considered for scale down. Value should be between 0 and 1. %s",
248+
classicOnlyHelpMsg),
241249
)
242250

243251
cmd.Flags().StringVar(
244252
&args.ScaleDown.DelayAfterAdd,
245253
fmt.Sprintf("%s%s", prefix, scaleDownDelayAfterAddFlag),
246254
"",
247-
"After a scale-up, consider scaling down only after this amount of time.",
255+
fmt.Sprintf("After a scale-up, consider scaling down only after this amount of time. %s",
256+
classicOnlyHelpMsg),
248257
)
249258

250259
cmd.Flags().StringVar(
251260
&args.ScaleDown.DelayAfterDelete,
252261
fmt.Sprintf("%s%s", prefix, scaleDownDelayAfterDeleteFlag),
253262
"",
254-
"After a scale-down, consider scaling down again only after this amount of time.",
263+
fmt.Sprintf("After a scale-down, consider scaling down again only after this amount of time. %s",
264+
classicOnlyHelpMsg),
255265
)
256266

257267
cmd.Flags().StringVar(
258268
&args.ScaleDown.DelayAfterFailure,
259269
fmt.Sprintf("%s%s", prefix, scaleDownDelayAfterFailureFlag),
260270
"",
261-
"After a failing scale-down, consider scaling down again only after this amount of time.",
271+
fmt.Sprintf("After a failing scale-down, consider scaling down again only after this amount of time. %s",
272+
classicOnlyHelpMsg),
262273
)
263274

264275
return args

0 commit comments

Comments
 (0)