Update kubectl help for 1.2 resources

This commit is contained in:
Janet Kuo
2016-03-21 14:00:43 -07:00
parent d124deeb2f
commit e93b855242
29 changed files with 126 additions and 112 deletions

View File

@@ -31,7 +31,7 @@ import (
const (
autoscaleLong = `Creates an autoscaler that automatically chooses and sets the number of pods that run in a kubernetes cluster.
Looks up a deployment or replication controller by name and creates an autoscaler that uses this deployment or replication controller as a reference.
Looks up a Deployment, ReplicaSet, 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 = `# Auto scale a deployment "foo", with the number of pods between 2 to 10, target CPU utilization at a default value that server applies:
@@ -45,7 +45,7 @@ func NewCmdAutoscale(f *cmdutil.Factory, out io.Writer) *cobra.Command {
filenames := []string{}
cmd := &cobra.Command{
Use: "autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU] [flags]",
Short: "Auto-scale a deployment or replication controller",
Short: "Auto-scale a Deployment, ReplicaSet, or ReplicationController",
Long: autoscaleLong,
Example: autoscaleExample,
Run: func(cmd *cobra.Command, args []string) {

View File

@@ -49,11 +49,7 @@ $ kubectl describe TYPE NAME_PREFIX
will first check for an exact match on TYPE and NAME_PREFIX. If no such resource
exists, it will output details for every resource that has a name prefixed with NAME_PREFIX
Possible resource types include (case insensitive): pods (po), services (svc),
replicationcontrollers (rc), nodes (no), events (ev), limitranges (limits),
persistentvolumes (pv), persistentvolumeclaims (pvc), resourcequotas (quota),
namespaces (ns), serviceaccounts, horizontalpodautoscalers (hpa),
endpoints (ep) or secrets.`
` + kubectl.PossibleResourceTypes
describe_example = `# Describe a node
kubectl describe nodes kubernetes-minion-emt8.c.myproject.internal

View File

@@ -36,11 +36,7 @@ kubectl explain pods.spec.containers`
explainLong = `Documentation of resources.
Possible resource types include: pods (po), services (svc),
replicationcontrollers (rc), nodes (no), events (ev), componentstatuses (cs),
limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc),
resourcequotas (quota), namespaces (ns), horizontalpodautoscalers (hpa)
or endpoints (ep).`
` + kubectl.PossibleResourceTypes
)
// NewCmdExplain returns a cobra command for swagger docs

View File

@@ -37,14 +37,14 @@ type ExposeOptions struct {
}
const (
expose_long = `Take a replication controller, service, replica set, deployment or pod and expose it as a new Kubernetes service.
expose_long = `Take a deployment, service, replica set, replication controller, or pod and expose it as a new Kubernetes service.
Looks up a replication controller, service, replica set, deployment or pod by name and uses the selector
for that resource as the selector for a new service on the specified port. A replica set will be exposed
as a service only if it's selector is convertible to a selector that service supports, i.e. when the
replica set selector contains only the matchLabels component. Note that if no port is specified
via --port and the exposed resource has multiple ports, all will be re-used by the new service. Also
if no labels are specified, the new service will re-use the labels from the resource it exposes.`
Looks up a deployment, service, replica set, replication controller or pod by name and uses the selector
for that resource as the selector for a new service on the specified port. A deployment or replica set
will be exposed as a service only if its selector is convertible to a selector that service supports,
i.e. when the selector contains only the matchLabels component. Note that if no port is specified via
--port and the exposed resource has multiple ports, all will be re-used by the new service. Also if no
labels are specified, the new service will re-use the labels from the resource it exposes.`
expose_example = `# Create a service for a replicated nginx, which serves on port 80 and connects to the containers on port 8000.
kubectl expose rc nginx --port=80 --target-port=8000
@@ -73,7 +73,7 @@ func NewCmdExposeService(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type]",
Short: "Take a replication controller, service or pod and expose it as a new Kubernetes Service",
Short: "Take a replication controller, service, or pod and expose it as a new Kubernetes Service",
Long: expose_long,
Example: expose_example,
Run: func(cmd *cobra.Command, args []string) {

View File

@@ -38,11 +38,7 @@ type GetOptions struct {
const (
get_long = `Display one or many resources.
Possible resource types include (case insensitive): pods (po), services (svc),
replicationcontrollers (rc), nodes (no), events (ev), componentstatuses (cs),
limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc),
resourcequotas (quota), namespaces (ns), endpoints (ep),
horizontalpodautoscalers (hpa), serviceaccounts or secrets.
` + kubectl.PossibleResourceTypes + `
By specifying the output as 'template' and providing a Go template as the value
of the --template flag, you can filter the attributes of the fetched resource(s).`

View File

@@ -24,7 +24,7 @@ import (
)
const (
rollout_long = `rollout manages a deployment using subcommands like "kubectl rollout undo deployment/abc"`
rollout_long = `Manages a deployment using subcommands like "kubectl rollout undo deployment/abc"`
rollout_example = `# Rollback to the previous deployment
kubectl rollout undo deployment/abc`
rollout_valid_resources = `Valid resource types include:

View File

@@ -35,9 +35,12 @@ type HistoryOptions struct {
}
const (
history_long = `view previous rollout revisions and configurations.`
history_long = `View previous rollout revisions and configurations.`
history_example = `# View the rollout history of a deployment
kubectl rollout history deployment/abc`
kubectl rollout history deployment/abc
# View the details of deployment revision 3
kubectl rollout history deployment/abc --revision=3`
)
func NewCmdRolloutHistory(f *cmdutil.Factory, out io.Writer) *cobra.Command {

View File

@@ -42,9 +42,12 @@ type UndoOptions struct {
}
const (
undo_long = `undo rolls back to a previous rollout.`
undo_long = `Rollback to a previous rollout.`
undo_example = `# Rollback to the previous deployment
kubectl rollout undo deployment/abc`
kubectl rollout undo deployment/abc
# Rollback to deployment revision 3
kubectl rollout undo deployment/abc --to-revision=3`
)
func NewCmdRolloutUndo(f *cmdutil.Factory, out io.Writer) *cobra.Command {

View File

@@ -37,14 +37,14 @@ type ScaleOptions struct {
}
const (
scale_long = `Set a new size for a Replication Controller, Job, or Deployment.
scale_long = `Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job.
Scale also allows users to specify one or more preconditions for the scale action.
If --current-replicas or --resource-version is specified, it is validated before the
scale is attempted, and it is guaranteed that the precondition holds true when the
scale is sent to the server.`
scale_example = `# Scale replication controller named 'foo' to 3.
kubectl scale --replicas=3 rc/foo
scale_example = `# Scale a replicaset named 'foo' to 3.
kubectl scale --replicas=3 rs/foo
# Scale a resource identified by type and name specified in "foo.yaml" to 3.
kubectl scale --replicas=3 -f foo.yaml
@@ -67,7 +67,7 @@ func NewCmdScale(f *cmdutil.Factory, out io.Writer) *cobra.Command {
Use: "scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME)",
// resize is deprecated
Aliases: []string{"resize"},
Short: "Set a new size for a Replication Controller, Job, or Deployment.",
Short: "Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job.",
Long: scale_long,
Example: scale_example,
Run: func(cmd *cobra.Command, args []string) {

View File

@@ -28,7 +28,15 @@ import (
"k8s.io/kubernetes/pkg/api/unversioned"
)
const kubectlAnnotationPrefix = "kubectl.kubernetes.io/"
const (
kubectlAnnotationPrefix = "kubectl.kubernetes.io/"
// TODO: auto-generate this
PossibleResourceTypes = `Possible resource types include (case insensitive): pods (po), services (svc), deployments,
replicasets (rs), replicationcontrollers (rc), nodes (no), events (ev), limitranges (limits),
persistentvolumes (pv), persistentvolumeclaims (pvc), resourcequotas (quota), namespaces (ns),
serviceaccounts, ingresses (ing), horizontalpodautoscalers (hpa), daemonsets (ds), configmaps,
componentstatuses (cs), endpoints (ep), and secrets.`
)
type NamespaceInfo struct {
Namespace string