Skip to main content
Version: v1.4.7

Getting Familiar With potctl

To list all available commands, just run potctl without any arguments. The available commands should look something like this:

$ potctl


██████╗ ██████╗ ████████╗ ██████╗████████╗██╗
██╔══██╗██╔═══██╗╚══██╔══╝██╔════╝╚══██╔══╝██║
██████╔╝██║ ██║ ██║ ██║ ██║ ██║
██╔═══╝ ██║ ██║ ██║ ██║ ██║ ██║
██║ ╚██████╔╝ ██║ ╚██████╗ ██║ ███████╗
╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚══════╝



Potctl is the CLI for Datasance PoT, an Enterprise version of Eclipse iofog. Think of it as a mix between terraform and kubectl.

Use `potctl version` to display the current version.

Find more information at: https://docs.datasance.com


Usage:
potctl [flags]
potctl [command]

Available Commands:
attach Attach one ioFog resource to another
completion Generate the autocompletion script for the specified shell
configure Configure potctl or ioFog resources
connect Connect to an existing Control Plane
create Create a resource
delete Delete an existing ioFog resource
deploy Deploy Edge Compute Network components on existing infrastructure
describe Get detailed information of an existing resources
detach Detach one ioFog resource from another
disconnect Disconnect from an ioFog cluster
exec Connect to an Exec Session of a resource
get Get information of existing resources
help Help about any command
legacy Execute commands using legacy CLI
logs Get log contents of deployed resource
move Move an existing resources inside the current Namespace
prune prune ioFog resources
rebuild Rebuilds a microservice or system-microservice
rename Rename the iofog resources that are currently deployed
rollback Rollback ioFog resources
start Starts a resource
stop Stops a resource
upgrade Upgrade ioFog resources
version Get CLI application version
view Open ECN Viewer

Flags:
--debug Toggle for displaying verbose output of API clients (HTTP and SSH)
-h, --help help for potctl
-n, --namespace string Namespace to execute respective command within (default "default")
-v, --verbose Toggle for displaying verbose output of potctl

Use "potctl [command] --help" for more information about a command.

You can also find all available commands, and a detailled documentation of their usage on our github repository.

You can use the --help flag on every command to learn more. Go ahead and try some of the following:

potctl deploy --help
potctl create --help
potctl connect --help
potctl get --help
potctl attach --help

Working with Namespaces

All actions performed with potctl are scoped to a single namespace. The default namespace ('default') is used if the user does not specify a namespace explicitly in the command. Note that namespaces in potctl map to a Kubernetes namespace when potctl is used to deploy an Edge Compute Network's ('ECN') Control Plane on Kubernetes.

Try creating, listing, and deleting namespaces now with the following commands.

potctl create namespace zoo-1
potctl get namespaces
potctl delete namespace zoo-1

Configuring your current namespace

It is possible to specify the namespace to use as current namespace by using the potctl configure command.

potctl configure current-namespace NAMESPACE

To revert to the default configuration, you can always run potctl configure current-namespace default.

View Edge Compute Network Details

Once we are connected to a live ECN, we can go ahead and do some introspection.

Try to display individual resources or all resources within a namespace with the get command:

potctl get controllers
potctl get agents
potctl get applications
potctl get microservices
potctl get all

To get more detailed information, we can use the describe command:

potctl describe controlplane
potctl describe controller alpaca-1
potctl describe agent kiwi-1
potctl describe application health-care-app
potctl describe microservice health-care-ui

Check the log output of components

Note: You will need ssh access to any remote resources to use this feature.

To check the log output of any resource, use logs e.g.

potctl logs controller NAME
potctl logs agent NAME
potctl logs microservice NAME

This will return either the log file from the machine, or the docker logs output of the running microservice.

Move microservices to another Agent

potctl move microservice NAME AGENT_NAME
potctl move microservice health-case-ui zebra-1

Prune Docker on an Agent

We can now manually prune the docker images on our Agents, if our Agent is running out of diskspace.

potctl prune agent AGENT_NAME

Detach / Attach an Agent

We can transfer an Agent from one ECN to another by detaching the agent and attaching it to another ECN. Note: detaching an agent will delete its connection with the Controller, and all microservices will be shut down.

potctl detach agent AGENT_NAME

Switch to another ECN / namespace

potctl attach agent AGENT_NAME

To display all resources in dettached state with the get command

potctl get all --detached

We can also move Agents between Namespaces with a single command. The following command will move agent-1 from namespace-1 to namespace-2:

potctl move agent agent-1 namespace-2 -n namespace-1
Group 3See anything wrong with the document? Help us improve it!