__ __ __ __ __ __ _ / /__ / /_ / / ____ / / ___ __ __ ___/ / ____ ____ / / (_) / '_// __/ / _ \/ __/ / / / _ \/ // // _ / /___// __/ / / / / /_/\_\ \__/ /_//_/\__/ /_/ \___/\_,_/ \_,_/ \__/ /_/ /_/
Note
This project is in the very early stages of development. Features are incomplete, and things may change frequently.
kthcloud-cli is a command-line interface tool for interacting with kthcloud’s API. It allows you to perform various operations such as listing deployments, creating api keys, and creating deployments from docker-compose files.
The clis core functionality is to parse docker compose files and create deployments from the content.
For example, if i have this docker-compose.yaml file:
services:
file-server:
image: phillezi/tinyhttpfileserver:latest
environment:
KTHCLOUD_CORES: 0.1
KTHCLOUD_RAM: 0.1
KTHCLOUD_VISIBILITY: auth
KTHCLOUD_HEALTH_PATH: "/"
ports:
- "8080:8080"
volumes:
- "./testpath:/static"
log-test-app1:
image: phillezi/litelogger:latest
environment:
KTHCLOUD_CORES: 0.1
KTHCLOUD_RAM: 0.1
KTHCLOUD_VISIBILITY: private
depends_on:
- file-server
log-test-app2:
image: phillezi/litelogger:latest
environment:
KTHCLOUD_CORES: 0.1
KTHCLOUD_RAM: 0.1
KTHCLOUD_VISIBILITY: private
depends_on: [log-test-app1]
log-test-app3:
image: phillezi/litelogger:latest
environment:
KTHCLOUD_CORES: 0.1
KTHCLOUD_RAM: 0.1
KTHCLOUD_VISIBILITY: privateNote
The above example showcases what is supported but does not provide a functional application.
The tool will create four deployments and set up their environment variables, port, start commands and persistent storage.
For Mac and Linux, there is an installation script that can be run to install the CLI.
- bash
- curl
curl -fsSL https://raw.githubusercontent.com/Phillezi/kthcloud-cli/main/scripts/install.sh | bash
Check out what the script does here.
There is a PowerShell installation script that can be run to install the CLI.
powershell -c "irm https://raw.githubusercontent.com/Phillezi/kthcloud-cli/main/scripts/install.ps1 | iex"
Check out what the script does here.
If you have go installed and with GOBIN set and added to PATH you can install the cli using:
go install github.com/Phillezi/kthcloud-cli@latestNote
The cli executable will be named kthcloud-cli from the module / repo name instead of kthcloud.
If your OS and architecture combo isnt available as a pre-built binary and you dont want to use go install you can build the cli from source.
-
Clone the repository:
git clone https://github.com/Phillezi/kthcloud-cli.git cd kthcloud-cli -
Build the application:
make # or # make install # make install adds it to the same dir as the install script does, but you will manually have to add it to your PATH.
-
Run the application:
./bin/kthcloud
Tip
Alternatively you can add it to the PATH to be able to use it globally. The installation script automatically does this.
The commands are described in docs/.
Logs in to kthcloud and retrieves an authentication token, the token gets saved to a file named session.json inside the configuration path. It opens a browser window to let you login through the kthcloud keycloak login page.
kthcloud loginParses a docker-compose.yaml, docker-compose.yml or *.docker-compose.yaml file (will prefer kthcloud.docker-compose.yaml/yml) and gives the ability to bring up these services with the specified configuration on kthcloud.
kthcloud compose # lists all optionsBrings up the services defined in the Docker Compose file.
Brings down the services defined in the Docker Compose file.
Note
This will not remove the volumes created on the storagemanager.
Parses a Docker Compose file and prints the Services, Envs, Ports, Commands, Depends on and Volumes. And prints out the resulting deployments (the json used with the REST API).
Checks for newer releases than the release of the binary running the command. If a newer release is found it will prompt you to install it, (can be bypassed wit the -y flag).
Versions can be selected by passing the -i flag.
Warning
This does not verify against a hash to confirm the integrity of the bibary (yet).
kthcloud updateDisplays the version of the binary.
kthcloud versionThe kthcloud-cli uses a configuration file named config.yaml it is located in the configuration directory. You can specify all the options that are available (run kthcloud --help too see them).
