Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
lpabon committed Aug 10, 2019
1 parent 2a7ff87 commit f199ea1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ Orchestration systems like Kubernetes. To use this tool you must first create a
context with the appropriate information. `px` uses the context to connect to
the appropriate Portworx cluster to execute the requested command.

## Installing as a kubectl plugin
Install `px` binary anywhere in your PATH and name it `kubectl-px`. You will
then be able to run it like this:

```
$ kubectl px get nodes
$ kubectl px get pvc
```

## Creating a context
You can create a context using the following command:

Expand All @@ -37,6 +28,11 @@ See `px context create --help` for more information like setting the Kubeconfig.

> NOTE: The default gRPC SDK port for Portworx is 9020
### Connecting to Portworx running on a Kuberentes Cloud
If you are running Portworx installed on a Kubernetes Cloud like GKE, EKS, etc,
you may need to use the workaround in issue #40 to access the Portworx gRPC
endpoint through the Kubernetes API.

### What if you don't have a Portworx cluster?
`px` uses the [OpenStorage SDK](https://libopenstorage.github.io) to communicate
with Portworx, therefore it is fully compatible with OpenStorage's
Expand All @@ -48,11 +44,20 @@ $ docker run --rm --name sdk -d -p 9100:9100 -p 9110:9110 openstorage/mock-sdk-s
$ px context create --name=mycluster --endpoint=localhost:9100
```

## Status
## Installing as a kubectl plugin
Install `px` binary anywhere in your PATH and name it `kubectl-px`. You will
then be able to run it like this:

```
$ kubectl px get nodes
$ kubectl px get pvc
```

## px sample commands
Now that `px` has been setup with a context, you can do the following commands:

```
$ px status
$ px describe cluster
$ px get volume
$ px get volume -o wide
$ px get nodes
Expand Down
13 changes: 10 additions & 3 deletions cmd/contextCreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ var contextCreateCmd *cobra.Command
var _ = RegisterCommandVar(func() {
// contextCreateCmd represents the contextCreate command
contextCreateCmd = &cobra.Command{
Use: "create [NAME]",
Short: "Create a context",
Example: "$ px context create mycluster --endpoint=123.456.1.10:9020",
Use: "create [NAME]",
Short: "Create a context",
Example: `
# To create a context called k8s which will communicate to a Kubernetes
# cluster and to one of the nodes running Portworx:
px context create mycluster --kubeconfig=/path/to/kubeconfig --endpoint=123.456.1.10:9020
# To create a context called mycluster which will point to one of the Portworx
# nodes on the cluster:
px context create mycluster --endpoint=123.456.1.10:9020`,
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return fmt.Errorf("Must supply a name for context")
Expand Down

0 comments on commit f199ea1

Please sign in to comment.