Skip to content

Commit f199ea1

Browse files
committed
save
1 parent 2a7ff87 commit f199ea1

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

README.md

+16-11
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@ Orchestration systems like Kubernetes. To use this tool you must first create a
1717
context with the appropriate information. `px` uses the context to connect to
1818
the appropriate Portworx cluster to execute the requested command.
1919

20-
## Installing as a kubectl plugin
21-
Install `px` binary anywhere in your PATH and name it `kubectl-px`. You will
22-
then be able to run it like this:
23-
24-
```
25-
$ kubectl px get nodes
26-
$ kubectl px get pvc
27-
```
28-
2920
## Creating a context
3021
You can create a context using the following command:
3122

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

3829
> NOTE: The default gRPC SDK port for Portworx is 9020
3930
31+
### Connecting to Portworx running on a Kuberentes Cloud
32+
If you are running Portworx installed on a Kubernetes Cloud like GKE, EKS, etc,
33+
you may need to use the workaround in issue #40 to access the Portworx gRPC
34+
endpoint through the Kubernetes API.
35+
4036
### What if you don't have a Portworx cluster?
4137
`px` uses the [OpenStorage SDK](https://libopenstorage.github.io) to communicate
4238
with Portworx, therefore it is fully compatible with OpenStorage's
@@ -48,11 +44,20 @@ $ docker run --rm --name sdk -d -p 9100:9100 -p 9110:9110 openstorage/mock-sdk-s
4844
$ px context create --name=mycluster --endpoint=localhost:9100
4945
```
5046

51-
## Status
47+
## Installing as a kubectl plugin
48+
Install `px` binary anywhere in your PATH and name it `kubectl-px`. You will
49+
then be able to run it like this:
50+
51+
```
52+
$ kubectl px get nodes
53+
$ kubectl px get pvc
54+
```
55+
56+
## px sample commands
5257
Now that `px` has been setup with a context, you can do the following commands:
5358

5459
```
55-
$ px status
60+
$ px describe cluster
5661
$ px get volume
5762
$ px get volume -o wide
5863
$ px get nodes

cmd/contextCreate.go

+10-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,16 @@ var contextCreateCmd *cobra.Command
3030
var _ = RegisterCommandVar(func() {
3131
// contextCreateCmd represents the contextCreate command
3232
contextCreateCmd = &cobra.Command{
33-
Use: "create [NAME]",
34-
Short: "Create a context",
35-
Example: "$ px context create mycluster --endpoint=123.456.1.10:9020",
33+
Use: "create [NAME]",
34+
Short: "Create a context",
35+
Example: `
36+
# To create a context called k8s which will communicate to a Kubernetes
37+
# cluster and to one of the nodes running Portworx:
38+
px context create mycluster --kubeconfig=/path/to/kubeconfig --endpoint=123.456.1.10:9020
39+
40+
# To create a context called mycluster which will point to one of the Portworx
41+
# nodes on the cluster:
42+
px context create mycluster --endpoint=123.456.1.10:9020`,
3643
Args: func(cmd *cobra.Command, args []string) error {
3744
if len(args) < 1 {
3845
return fmt.Errorf("Must supply a name for context")

0 commit comments

Comments
 (0)