diff options
author | Ava Hahn <a.hahn@f5.com> | 2024-05-01 18:21:55 -0700 |
---|---|---|
committer | avahahn <110854134+avahahn@users.noreply.github.com> | 2024-05-08 13:30:08 -0700 |
commit | 1d237990c589a90d7ec85f211c01b709b1e5dc65 (patch) | |
tree | cf22dcc26a81a111615918d3243c32dfdc3550cb /tools/unitctl/README.md | |
parent | f6989dd67965c7489f8c68ecd0e25f0358b5993f (diff) | |
download | unit-1d237990c589a90d7ec85f211c01b709b1e5dc65.tar.gz unit-1d237990c589a90d7ec85f211c01b709b1e5dc65.tar.bz2 |
tools/unitctl: Add new functionality to README.md and fmt code
Signed-off-by: Ava Hahn <a.hahn@f5.com>
Diffstat (limited to 'tools/unitctl/README.md')
-rw-r--r-- | tools/unitctl/README.md | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/tools/unitctl/README.md b/tools/unitctl/README.md index 7292cd86..e514cd56 100644 --- a/tools/unitctl/README.md +++ b/tools/unitctl/README.md @@ -36,9 +36,9 @@ desired. ## Features (Current) -### Consumes alternative configuration formats Like YAML and converts them -### Syntactic highlighting of JSON output -### Interpretation of UNIT errors with (arguably more) useful error messages +- Consumes alternative configuration formats Like YAML and converts them +- Syntactic highlighting of JSON output +- Interpretation of UNIT errors with (arguably more) useful error messages ### Lists all running UNIT processes and provides details about each process. ``` @@ -52,6 +52,30 @@ unitd instance [pid: 79489, version: 1.32.0]: Configure options: --prefix=/opt/unit --user=elijah --group=elijah --openssl ``` +### Start a new UNIT process via docker +``` +$ unitctl instances new /tmp/2 $(pwd) 'unit:wasm' +Pulling and starting a container from unit:wasm +Will mount /tmp/2 to /var/run for socket access +Will READ ONLY mount /home/ava/repositories/nginx/unit/tools/unitctl to /www for application access +Note: Container will be on host network + +``` + +To the subcommand `unitctl instances new` the user must provide three things: +1. **A directory such as `/tmp/2`.** + The UNIT container will mount this to `/var/run` internally. + Thus, the control socket and pid file will be accessible from the host. +2. **A path to an application.** + In the example, `$(pwd)` is provided. The UNIT container will mount + this READ ONLY to `/www/`. This will allow the user to configure + their UNIT container to expose an application stored on the host. +3. **An image tag.** + In the example, `unit:wasm` is used. This will be the image that unitctl + will deploy. Custom repos and images can be deployed in this manner. + +After deployment the user will have one UNIT container running on the host network. + ### Lists active listeners from running UNIT processes ``` unitctl listeners @@ -109,13 +133,6 @@ $ unitctl edit } ``` -### Display interactive OpenAPI control panel -``` -$ unitctl ui -Starting UI server on http://127.0.0.1:3000/control-ui/ -Press Ctrl-C to stop the server -``` - ### Import configuration, certificates, and NJS modules from directory ``` $ unitctl import /opt/unit/config @@ -124,6 +141,7 @@ Imported /opt/unit/config/hello.js -> /js_modules/hello.js Imported /opt/unit/config/put.json -> /config Imported 3 files ``` + ### Wait for socket to become available ``` $ unitctl --wait-timeout-seconds=3 --wait-max-tries=4 import /opt/unit/config` @@ -131,4 +149,4 @@ Waiting for 3s control socket to be available try 2/4... Waiting for 3s control socket to be available try 3/4... Waiting for 3s control socket to be available try 4/4... Timeout waiting for unit to start has been exceeded -```
\ No newline at end of file +``` |