diff --git a/pkg/kubectl/cmd/autoscale/autoscale.go b/pkg/kubectl/cmd/autoscale/autoscale.go index b88d77c1d9..9f59e7bbd8 100644 --- a/pkg/kubectl/cmd/autoscale/autoscale.go +++ b/pkg/kubectl/cmd/autoscale/autoscale.go @@ -42,7 +42,7 @@ var ( autoscaleLong = templates.LongDesc(i18n.T(` Creates an autoscaler that automatically chooses and sets the number of pods that run in a kubernetes cluster. - Looks up a Deployment, ReplicaSet, or ReplicationController by name and creates an autoscaler that uses the given resource as a reference. + Looks up a Deployment, ReplicaSet, StatefulSet, or ReplicationController by name and creates an autoscaler that uses the given resource as a reference. An autoscaler can automatically increase or decrease number of pods deployed within the system as needed.`)) autoscaleExample = templates.Examples(i18n.T(` diff --git a/pkg/kubectl/polymorphichelpers/canbeautoscaled.go b/pkg/kubectl/polymorphichelpers/canbeautoscaled.go index 696e69a0f4..c91e816f7d 100644 --- a/pkg/kubectl/polymorphichelpers/canbeautoscaled.go +++ b/pkg/kubectl/polymorphichelpers/canbeautoscaled.go @@ -31,6 +31,7 @@ func canBeAutoscaled(kind schema.GroupKind) error { corev1.SchemeGroupVersion.WithKind("ReplicationController").GroupKind(), appsv1.SchemeGroupVersion.WithKind("Deployment").GroupKind(), appsv1.SchemeGroupVersion.WithKind("ReplicaSet").GroupKind(), + appsv1.SchemeGroupVersion.WithKind("StatefulSet").GroupKind(), extensionsv1beta1.SchemeGroupVersion.WithKind("Deployment").GroupKind(), extensionsv1beta1.SchemeGroupVersion.WithKind("ReplicaSet").GroupKind(): // nothing to do here diff --git a/pkg/kubectl/polymorphichelpers/canbeautoscaled_test.go b/pkg/kubectl/polymorphichelpers/canbeautoscaled_test.go index a4cbe03f9e..b1e1fc92f0 100644 --- a/pkg/kubectl/polymorphichelpers/canbeautoscaled_test.go +++ b/pkg/kubectl/polymorphichelpers/canbeautoscaled_test.go @@ -38,6 +38,10 @@ func TestCanBeAutoscaled(t *testing.T) { kind: appsv1.SchemeGroupVersion.WithKind("Deployment").GroupKind(), expectErr: false, }, + { + kind: appsv1.SchemeGroupVersion.WithKind("StatefulSet").GroupKind(), + expectErr: false, + }, { kind: extensionsv1beta1.SchemeGroupVersion.WithKind("ReplicaSet").GroupKind(), expectErr: false,