Package: kuberos-cli
KubeROS Command Line ToolThis repo contains the cli tools for users to interact with KubeROS platform.InstallationThere are three methods to install the cli tool.1. Install in local pathKubeROS CLI tool depends only on the following common packages, it should not cause the compatibility problem with other packages.argcompletePyYAMLrequeststabulateRequired python version:python >= 3.8# install python3-pipsudoaptupdate
sudoaptinstallpython3-pipOptional 1: install this system-wideThe python packages will be installed in/usr/lib/python3/dist-packagesThekuberosscript will be installed in/usr/local/bin# Instal KubeROS CLIsudopipinstall--systemkuberos-cli# enable autocompletionactivate-global-python-argcompleteOpotion 2: using the defaultUser SchemeThe packages are installed in~/.local/lib/python3/The executable scripts are in~/.local/binIn this case, you have to add the~/.local/binto the$PATH# Instal KubeROS CLIpipinstallkuberos-cli# export ~/.local/bin to $PATH in .bashrc or .bash_profileecho'export PATH=$PATH:~/.local/bin'>>~/.bashrcsource~/.bashrc# enable autocompletionactivate-global-python-argcomplete2. Install in Virtual Environment (Venv)You can install this CLI tool in an isolated Python environment withvenvto avoid interfering with other projects due to dependencies.Create aVenvand add thevenv/binto$PATHsudoaptupdate
sudoaptinstallpython3-venv# create a virtual environmentcd<workdirectory>
python3-mvenvkuberos_cli_venv# add the kuberos_cli_venv/bin to PATHcdkuberos_cli_venv/binpwd# get the absolute path <local-bin-path-in-venv># replace the <local-bin-path-in-venv> with the path printed above# add it to .bashrc, or another profile depending on the terminal tool you are usingecho'export PATH=$PATH:<local-bin-path-in-venv>'>>~/.bashrcInstallkuberos-cliwithpip:pipinstallkuberos-cli# enable autocompletion goballyactivate-global-python-argcomplete3. From source (For Development)gitclonehttps://github.com/kuberos-io/kuberos-cli.gitcdkuberos-cli
pipinstall-rrequirements.txt# build it (optional)python3-mbuild
pip3install-U.# enable arg auto completioneval"$(register-python-argcompletekuberos)"# override the python path to use the library from sourceecho$PYTHONPATH=$PYTHONPATH:<path-to-source-code># e.g. ~/ws/kuberos-cliUsageThis CLI tool follows the conventions of theROS2 CLIand uses the following style.kuberos<command_group><command>[name][-args]You can get the help for each command group withkuberos <command_group> -hor just typekuberos <command_group>.For example, to deploy, check and delete deployments, you can use following commands:# Create a deploymentkuberosdeploycreate-f<path-to-deployment-manifest># List all deploymentskuberosdeploylist# Get the deployment statuskuberosdeployinfo<deployment-name># Delete a deploymentkuberosdeploydelete<deployment-name>ExamplesGet the cluster status usingkuberos cluster info -s -u <cluster-name>.Cluster Name: kube
API Server: https://<api-server>:6443
Alive Age: 1 month, 1 week
Since Last Sync: 0 minutes

Robot Onboard Computers
--------------------------------------------------------------------------------
ROBOT_NAME    HOSTNAME        DEVICE_GROUP    IS_ALIVE    AVAILABLE    FLEET    PERIPHERALS
simbot-2      kube-simbot-02  simbot-pc       True        False        xx       ['rs-d435']
simbot-1      kube-simbot-01  simbot-pc       True        False        xx       ['rs-d435']

Edge Nodes
--------------------------------------------------------------------------------
HOSTNAME             GROUP    SHARED RESOURCE    IS_ALIVE    AVAILABLE    REACHABLE
kube-edge-worker-02  public   True               True        True         True
kube-edge-worker-01  public   True               True        True         True
kube-edge-worker-03  public   True               True        True         True
kube-edge-worker-04  public   True               True        True         True
kube-storage         storage  True               True        True         True

Control Plane Nodes
--------------------------------------------------------------------------------
HOSTNAME     ROLE           REGISTERED    IS_ALIVE    AVAILABLE    REACHABLE
kube-master  control_plane  True          True        False        True

Resource Usages
--------------------------------------------------------------------------------
HOSTNAME             CPU (Cores)    Memory (Gb)        Storage (Gb)
kube-edge-worker-02  0.04/4 (0.9%)  1.99/8.1 (24.4%)   N/A/40.5
kube-master          0.12/4 (3.0%)  4.37/8.1 (53.7%)   N/A/12.3
kube-simbot-02       0.06/4 (1.5%)  3.77/8.1 (46.4%)   N/A/40.5
kube-edge-worker-01  0.04/8 (0.5%)  3.98/16.4 (24.3%)  N/A/50.6
kube-simbot-01       0.04/8 (0.4%)  2.81/16.4 (17.1%)  N/A/50.6
kube-edge-worker-03  0.04/8 (0.5%)  3.46/16.4 (21.1%)  N/A/40.5
kube-edge-worker-04  0.04/8 (0.5%)  3.10/16.4 (18.9%)  N/A/50.6
kube-storage         0.03/4 (0.7%)  2.94/8.1 (36.1%)   N/A/203.1For example, check the status of the target fleet before deploying a new application withkuberos fleet info example-fleet.Fleet Name: example-fleet
Healthy: True
Fleet status: idle
Alive Age: 15 hours, 14 minutes
Main Cluster: kube
Description: Test fleet
Created since: 15 hours, 14 minutes
========================================
Robot Name      Id  Hostname        Computer Group    Reachable    Status      Shared Resource
simbot-1         1  kube-simbot-01  simbot-pc         True         deployable  False
simbot-2         2  kube-simbot-02  simbot-pc         True         deployable  False