This website/page will be End-of-life (EOL) after 31 August 2024. We recommend you to visit OpenEBS Documentation for the latest Mayastor documentation (v2.6 and above).
Mayastor is now also referred to as OpenEBS Replicated PV Mayastor.
The ‘Mayastor kubectl plugin’ can be used to view and manage Mayastor resources such as nodes, pools and volumes. It is also used for operations such as scaling the replica count of volumes.
Prerequisites
Ensure that port 30011 is open. This port will be needed by Mayastor kubectl plugin to communicate to REST servers from outside the cluster.
The plugin requires access to the Mayastor REST server for execution. It usually obtains the correct endpoint from the kube-config file on its own. However, if the plugin is unable to access the endpoint, the master nodes's IP needs to be specified manually using the --rest or -r flag.
kubectl mayastor [OPTIONS] --rest=http://:30011
Installation
The Mayastor kubectl plugin is available for the Linux platform. The binary for the plugin can be found here.
Add the downloaded Mayastor kubectl plugin under $PATH.
To verify the installation, execute:
kubectl mayastor -V
kubectl-plugin 1.0.0
Using Mayastor kubectl plugin
USAGE:
kubectl-mayastor [OPTIONS] <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-j, --jaeger <jaeger> Trace rest requests to the Jaeger endpoint agent
-o, --output <output> The Output, viz yaml, json [default: none] [possible values: yaml, json, none]
-r, --rest <rest> The rest endpoint, parsed from KUBECONFIG, if left empty
-t, --timeout <timeout> Timeout for the REST operations [default: 10s]
SUBCOMMANDS:
get 'Get' resources
help Prints this message or the help of the given subcommand(s)
scale 'Scale' resources
The plugin can be used to get the following resource information:
Volumes
kubectl mayastor get volumes
ID REPLICAS TARGET-NODE ACCESSIBILITY STATUS SIZE
18e30e83-b106-4e0d-9fb6-2b04e761e18a 4 mayastor-1 nvmf Online 10485761
0c08667c-8b59-4d11-9192-b54e27e0ce0f 4 mayastor-2 <none> Online 10485761
Pools
kubectl mayastor get pools
ID TOTAL CAPACITY USED CAPACITY DISKS NODE STATUS MANAGED
mayastor-pool-1 5360320512 1111490560 aio:///dev/vdb?uuid=d8a36b4b-0435-4fee-bf76-f2aef980b833 kworker1 Online true
mayastor-pool-2 5360320512 2172649472 aio:///dev/vdc?uuid=bb12ec7d-8fc3-4644-82cd-dee5b63fc8c5 kworker1 Online true
mayastor-pool-3 5360320512 3258974208 aio:///dev/vdb?uuid=f324edb7-1aca-41ec-954a-9614527f77e1 kworker2 Online false
Nodes
kubectl mayastor get nodes
ID GRPC ENDPOINT STATUS
mayastor-2 10.1.0.7:10124 Online
mayastor-1 10.1.0.6:10124 Online
mayastor-3 10.1.0.8:10124 Online
All the above resource information can be retrieved for a particular resource using its ID. The command to do so is as follows: kubectl mayastor get <resource_name> <resource_id>
The Mayastor kubectl plugin can also be used for performing the following operations:
kubectl mayastor get volume-replica-topology <volume_id>
ID NODE POOL STATUS
93b1e1e9-ffcd-4c56-971e-294a530ea5cd ksnode-2 pool-on-ksnode-2 Online
88d89a92-40cf-4147-97d4-09e64979f548 ksnode-3 pool-on-ksnode-3 Online
The plugin requires access to the Mayastor REST server for execution. It gets the master node IP from the kube-config file. In case of any failure, the REST endpoint can be specified using the ‘–rest’ flag.
Limitations:
The plugin currently does not have authentication support.
The plugin can operate only over HTTP.
In the case of a cluster with multiple master nodes, the plugin by default picks up the first master node IP for accessing the REST service. In case the REST service is not accessible using the selected master node IP, the plugin would not be able to pick up an alternate master node IP by default.