Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubectl proxy --help is missing description of the command #45736

Closed
ahmetb opened this issue May 12, 2017 · 2 comments · Fixed by #45781
Closed

kubectl proxy --help is missing description of the command #45736

ahmetb opened this issue May 12, 2017 · 2 comments · Fixed by #45781
Labels
sig/cli Categorizes an issue or PR as relevant to SIG CLI.

Comments

@ahmetb
Copy link
Member

ahmetb commented May 12, 2017

kubectl Version: 1.6.2

Problem: kubectl proxy --help command directly jumps into the examples of the command without explaining what the command does. For example:

$ kubectl proxy -h
To proxy all of the kubernetes api and nothing else, use: 

  $ kubectl proxy --api-prefix=/
  
To proxy only part of the kubernetes api and also some static files: 

  $ kubectl proxy --www=/my/files --www-prefix=/static/ --api-prefix=/api/
  
The above lets you 'curl localhost:8001/api/v1/pods'. 

To proxy the entire kubernetes api at a different root, use: 

  $ kubectl proxy --api-prefix=/custom/
  
The above lets you 'curl localhost:8001/custom/api/v1/pods'

Examples:
  # Run a proxy to kubernetes apiserver on port 8011, serving static content from ./local/www/
  kubectl proxy --port=8011 --www=./local/www/
  
  # Run a proxy to kubernetes apiserver on an arbitrary local port.
  # The chosen port for the server will be output to stdout.
  kubectl proxy --port=0
  
  # Run a proxy to kubernetes apiserver, changing the api prefix to k8s-api
  # This makes e.g. the pods api available at localhost:8001/k8s-api/v1/pods/
  kubectl proxy --api-prefix=/k8s-api
...

Compare this with:

 kubectl apply -h
Apply a configuration to a resource by filename or stdin. This resource will be created if it doesn't exist yet. To use
'apply', always create the resource initially with either 'apply' or 'create --save-config'.

JSON and YAML formats are accepted.

Alpha Disclaimer: the --prune functionality is not yet complete. Do not use unless you are aware of what the current
state is. See https://issues.k8s.io/34274.

Examples:
[...]
$ kubectl rollout -h
Manage a deployment using subcommands like "kubectl rollout undo deployment/abc"

Examples:
[...]
@jagosan
Copy link
Contributor

jagosan commented May 12, 2017

/sig cli
/kind enhancement

@suyogbarve
Copy link
Contributor

Sent PR for this
#45902

robertojrojas added a commit to robertojrojas/kubernetes that referenced this issue May 22, 2017
k8s-github-robot pushed a commit that referenced this issue May 23, 2017
Automatic merge from submit-queue (batch tested with PRs 38990, 45781, 46225, 44899, 43663)

kubectl: fixes issues #45736 and #45737

**What this PR does / why we need it**:
This PR improves the help displayed by the `kubectl proxy` command.

**Which issue this PR fixes**: 
fixes #45736, fixes #45737 

**Special notes for your reviewer**:
NONE

**Release note**:
NONE

```release-note
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/cli Categorizes an issue or PR as relevant to SIG CLI.
Projects
None yet
4 participants