Skip to content

Commit

Permalink
Implement kubectl autoscale
Browse files Browse the repository at this point in the history
  • Loading branch information
janetkuo committed Oct 19, 2015
1 parent cadb6c0 commit 8105aa4
Show file tree
Hide file tree
Showing 14 changed files with 678 additions and 92 deletions.
2 changes: 2 additions & 0 deletions .generated_docs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ docs/man/man1/kubectl-annotate.1
docs/man/man1/kubectl-api-versions.1
docs/man/man1/kubectl-apply.1
docs/man/man1/kubectl-attach.1
docs/man/man1/kubectl-autoscale.1
docs/man/man1/kubectl-cluster-info.1
docs/man/man1/kubectl-config-set-cluster.1
docs/man/man1/kubectl-config-set-context.1
Expand Down Expand Up @@ -40,6 +41,7 @@ docs/user-guide/kubectl/kubectl_annotate.md
docs/user-guide/kubectl/kubectl_api-versions.md
docs/user-guide/kubectl/kubectl_apply.md
docs/user-guide/kubectl/kubectl_attach.md
docs/user-guide/kubectl/kubectl_autoscale.md
docs/user-guide/kubectl/kubectl_cluster-info.md
docs/user-guide/kubectl/kubectl_config.md
docs/user-guide/kubectl/kubectl_config_set-cluster.md
Expand Down
38 changes: 38 additions & 0 deletions contrib/completions/bash/kubectl
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,43 @@ _kubectl_expose()
must_have_one_noun=()
}

_kubectl_autoscale()
{
last_command="kubectl_autoscale"
commands=()

flags=()
two_word_flags=()
flags_with_completion=()
flags_completion=()

flags+=("--cpu-percent=")
flags+=("--dry-run")
flags+=("--filename=")
flags_with_completion+=("--filename")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|stdin|yaml|yml")
flags+=("--generator=")
flags+=("--max=")
flags+=("--min=")
flags+=("--name=")
flags+=("--no-headers")
flags+=("--output=")
two_word_flags+=("-o")
flags+=("--output-version=")
flags+=("--show-all")
flags+=("-a")
flags+=("--sort-by=")
flags+=("--template=")
two_word_flags+=("-t")

must_have_one_flag=()
must_have_one_flag+=("--max=")
must_have_one_noun=()
}

_kubectl_label()
{
last_command="kubectl_label"
Expand Down Expand Up @@ -1211,6 +1248,7 @@ _kubectl()
commands+=("run")
commands+=("stop")
commands+=("expose")
commands+=("autoscale")
commands+=("label")
commands+=("annotate")
commands+=("config")
Expand Down
196 changes: 196 additions & 0 deletions docs/man/man1/kubectl-autoscale.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" ""


.SH NAME
.PP
kubectl autoscale \- Auto\-scale a replication controller


.SH SYNOPSIS
.PP
\fBkubectl autoscale\fP [OPTIONS]


.SH DESCRIPTION
.PP
Creates an autoscaler that automatically chooses and sets the number of pods that run in a kubernetes cluster.

.PP
Looks up a replication controller by name and creates an autoscaler that uses this replication controller as a reference.
An autoscaler can automatically increase or decrease number of pods deployed within the system as needed.


.SH OPTIONS
.PP
\fB\-\-cpu\-percent\fP=\-1
The target average CPU utilization (represented as a percent of requested CPU) over all the pods. If it's not specified or negative, the server will apply a default value.

.PP
\fB\-\-dry\-run\fP=false
If true, only print the object that would be sent, without creating it.

.PP
\fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to a file identifying the resource to get from a server.

.PP
\fB\-\-generator\fP="horizontalpodautoscaler/v1beta1"
The name of the API generator to use. Currently there is only 1 generator.

.PP
\fB\-\-max\fP=\-1
The upper limit for the number of pods that can be set by the autoscaler. Required.

.PP
\fB\-\-min\fP=\-1
The lower limit for the number of pods that can be set by the autoscaler. If it's not specified or negative, the server will apply a default value.

.PP
\fB\-\-name\fP=""
The name for the newly created object. If not specified, the name of the input resource will be used.

.PP
\fB\-\-no\-headers\fP=false
When using the default output, don't print headers.

.PP
\fB\-o\fP, \fB\-\-output\fP=""
Output format. One of: json|yaml|wide|name|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See golang template [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
\[la]http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md\[ra]].

.PP
\fB\-\-output\-version\fP=""
Output the formatted object with the given version (default api\-version).

.PP
\fB\-a\fP, \fB\-\-show\-all\fP=false
When printing, show all resources (default hide terminated pods.)

.PP
\fB\-\-sort\-by\fP=""
If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string.

.PP
\fB\-t\fP, \fB\-\-template\fP=""
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].


.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
\fB\-\-alsologtostderr\fP=false
log to standard error as well as files

.PP
\fB\-\-api\-version\fP=""
The API version to use when talking to the server

.PP
\fB\-\-certificate\-authority\fP=""
Path to a cert. file for the certificate authority.

.PP
\fB\-\-client\-certificate\fP=""
Path to a client key file for TLS.

.PP
\fB\-\-client\-key\fP=""
Path to a client key file for TLS.

.PP
\fB\-\-cluster\fP=""
The name of the kubeconfig cluster to use

.PP
\fB\-\-context\fP=""
The name of the kubeconfig context to use

.PP
\fB\-\-insecure\-skip\-tls\-verify\fP=false
If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.

.PP
\fB\-\-kubeconfig\fP=""
Path to the kubeconfig file to use for CLI requests.

.PP
\fB\-\-log\-backtrace\-at\fP=:0
when logging hits line file:N, emit a stack trace

.PP
\fB\-\-log\-dir\fP=""
If non\-empty, write log files in this directory

.PP
\fB\-\-log\-flush\-frequency\fP=5s
Maximum number of seconds between log flushes

.PP
\fB\-\-logtostderr\fP=true
log to standard error instead of files

.PP
\fB\-\-match\-server\-version\fP=false
Require server version to match client version

.PP
\fB\-\-namespace\fP=""
If present, the namespace scope for this CLI request.

.PP
\fB\-\-password\fP=""
Password for basic authentication to the API server.

.PP
\fB\-s\fP, \fB\-\-server\fP=""
The address and port of the Kubernetes API server

.PP
\fB\-\-stderrthreshold\fP=2
logs at or above this threshold go to stderr

.PP
\fB\-\-token\fP=""
Bearer token for authentication to the API server.

.PP
\fB\-\-user\fP=""
The name of the kubeconfig user to use

.PP
\fB\-\-username\fP=""
Username for basic authentication to the API server.

.PP
\fB\-\-v\fP=0
log level for V logs

.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging


.SH EXAMPLE
.PP
.RS

.nf
# Auto scale a replication controller "foo", with the number of pods between 2 to 10, target CPU utilization at a default value that server applies:
$ kubectl autoscale rc foo \-\-min=2 \-\-max=10

# Auto scale a replication controller "foo", with the number of pods between 1 to 5, target CPU utilization at 80%:
$ kubectl autoscale rc foo \-\-max=5 \-\-cpu\-percent=80

.fi
.RE


.SH SEE ALSO
.PP
\fBkubectl(1)\fP,


.SH HISTORY
.PP
January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since!
2 changes: 1 addition & 1 deletion docs/man/man1/kubectl.1
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Find more information at

.SH SEE ALSO
.PP
\fBkubectl\-get(1)\fP, \fBkubectl\-describe(1)\fP, \fBkubectl\-create(1)\fP, \fBkubectl\-replace(1)\fP, \fBkubectl\-patch(1)\fP, \fBkubectl\-delete(1)\fP, \fBkubectl\-edit(1)\fP, \fBkubectl\-apply(1)\fP, \fBkubectl\-namespace(1)\fP, \fBkubectl\-logs(1)\fP, \fBkubectl\-rolling\-update(1)\fP, \fBkubectl\-scale(1)\fP, \fBkubectl\-attach(1)\fP, \fBkubectl\-exec(1)\fP, \fBkubectl\-port\-forward(1)\fP, \fBkubectl\-proxy(1)\fP, \fBkubectl\-run(1)\fP, \fBkubectl\-stop(1)\fP, \fBkubectl\-expose(1)\fP, \fBkubectl\-label(1)\fP, \fBkubectl\-annotate(1)\fP, \fBkubectl\-config(1)\fP, \fBkubectl\-cluster\-info(1)\fP, \fBkubectl\-api\-versions(1)\fP, \fBkubectl\-version(1)\fP, \fBkubectl\-explain(1)\fP, \fBkubectl\-convert(1)\fP,
\fBkubectl\-get(1)\fP, \fBkubectl\-describe(1)\fP, \fBkubectl\-create(1)\fP, \fBkubectl\-replace(1)\fP, \fBkubectl\-patch(1)\fP, \fBkubectl\-delete(1)\fP, \fBkubectl\-edit(1)\fP, \fBkubectl\-apply(1)\fP, \fBkubectl\-namespace(1)\fP, \fBkubectl\-logs(1)\fP, \fBkubectl\-rolling\-update(1)\fP, \fBkubectl\-scale(1)\fP, \fBkubectl\-attach(1)\fP, \fBkubectl\-exec(1)\fP, \fBkubectl\-port\-forward(1)\fP, \fBkubectl\-proxy(1)\fP, \fBkubectl\-run(1)\fP, \fBkubectl\-stop(1)\fP, \fBkubectl\-expose(1)\fP, \fBkubectl\-autoscale(1)\fP, \fBkubectl\-label(1)\fP, \fBkubectl\-annotate(1)\fP, \fBkubectl\-config(1)\fP, \fBkubectl\-cluster\-info(1)\fP, \fBkubectl\-api\-versions(1)\fP, \fBkubectl\-version(1)\fP, \fBkubectl\-explain(1)\fP, \fBkubectl\-convert(1)\fP,


.SH HISTORY
Expand Down
3 changes: 2 additions & 1 deletion docs/user-guide/kubectl/kubectl.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ kubectl
* [kubectl api-versions](kubectl_api-versions.md) - Print available API versions.
* [kubectl apply](kubectl_apply.md) - Apply a configuration to a resource by filename or stdin
* [kubectl attach](kubectl_attach.md) - Attach to a running container.
* [kubectl autoscale](kubectl_autoscale.md) - Auto-scale a replication controller
* [kubectl cluster-info](kubectl_cluster-info.md) - Display cluster info
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
* [kubectl convert](kubectl_convert.md) - Convert config files between different API versions
Expand All @@ -104,7 +105,7 @@ kubectl
* [kubectl stop](kubectl_stop.md) - Deprecated: Gracefully shut down a resource by name or filename.
* [kubectl version](kubectl_version.md) - Print the client and server version information.

###### Auto generated by spf13/cobra on 9-Oct-2015
###### Auto generated by spf13/cobra on 16-Oct-2015

<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl.md?pixel)]()
Expand Down
Loading

0 comments on commit 8105aa4

Please sign in to comment.