Package Deployment
This page provides an overview of how to use the package deploy and teardown commands in the CLI.
Once a package has been uploaded to kdb Insights Enterprise, it is ready for deployment.
- Run the Deploy command to bring your configurations online, as shown below.
- Run the Teardown command to stop a running package.
Using the web interface or the CLI
kdb Insights Enterprise has both a web interface and command line interface (CLI). You can use either one to deploy or tear down a package. For information on how to deploy a database or pipeline configuration using the web interface, navigate here.
Deploy
The deploy command enables you to deploy the database and pipeline configuration defined in your package inside kdb Insights Enterprise. It can be run as follows:
kxi pm deploy mypackage
This finds the latest version of the package to deploy. To deploy a specific version:
kxi pm deploy mypackage 1.0.0
This command searches kdb Insights Enterprise for mypackage
, version=1.0.0
and deploys its contents.
You can use the help command to provide information regarding the additional options.
Usage: kxi pm deploy [OPTIONS] PACKAGE [VERSION]
Deploy a package to an insights instance.
PACKAGE: package-name VERSION: package-version
╭─ Authentication option overrides ────────────────────────────────────────────╮
│ --hostname,--url TEXT Insights URL │
│ --realm TEXT Realm │
│ --client-id TEXT Client id │
│ --client-secret TEXT Client secret │
│ --auth-enabled/--auth-disabled Retrieve Bearer Token │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --env TEXT Inject environment variables to the │
│ deployed package. │
│ `[component_name:]VAR=value` │
│ --output-format -o [json|table] Output format for the list command │
│ --server-timeout TEXT Timeout for Insights server calls │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
Refer to the tracking deployments section further down for information on how to verify the status of your package.
Inject Environment Variables
You can inject environment variables when you deploy a package to make small changes to settings in your package, such as to increase or decrease an application limit.
Inject environment variables during the deploy
command using the --env
modifier, as shown in the following example:
kxi pm deploy mypackage --env myenvar=1
In the example above, kdb Insights Enterprise deploys the package named mypackage
and sets the myenvar
environment variable to a value of 1 on every process.
To change the value of myenvar
, run the deploy command again with the new desired value. The command automatically tears down the existing deployment and deploys again with the new value.
Tear Down
The teardown
command enables you to:
- Stop packages in
RUNNING
state, and take the databases and pipelines offline. - [Optionally] Remove persistant application data from disk.
The teardown
command can take the name or id of the package deployed on kdb Insights Enterprise. If the package is found and in running state, it is taken offline.
It can be run as follows:
kxi pm teardown mypackage
You can use the help command to provide information regarding the additional options
Usage: kxi pm teardown [OPTIONS] PACKAGE
Teardown a deployed package running on an insights instance
╭─ Authentication option overrides ────────────────────────────────────────────╮
│ --hostname,--url TEXT Insights URL │
│ --realm TEXT Realm │
│ --client-id TEXT Client id │
│ --client-secret TEXT Client secret │
│ --auth-enabled/--auth-disabled Retrieve Bearer Token │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --rm-data Remove the data associated with the │
│ deployment │
│ --output-format -o [json|table] Output format for the list command │
│ --server-timeout TEXT Timeout for Insights server calls │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
Track Deployments
To find the status of the running deployments use the following command. This lists all the packages with default fields, as shown in the example below.
kxi pm list
╭────────────────────────┬─────────────────────┬─────────────────────┬───────┬────────┬───────────────────────────────────┬──────────────────────────────────────╮
│ name │ version │ deployment.status │ data │ access │ owner.name │ id │
├────────────────────────┼─────────────────────┼─────────────────────┼───────┼────────┼───────────────────────────────────┼──────────────────────────────────────┤
│ pkg-test1 │ 0.0.7 │ RUNNING │ yes │ ARWX │ service-account-test-publisher │ 253a6bc0-7672-4aa4-b3ff-655dc6826005 │
│ pkg-test-2 │ 0.0.1 │ Deployment Error │ yes │ ARWX │ user1 │ 3fb61cd9-0522-453f-8591-66a954ce07fd │
│ pkg-test-3 │ 0.0.1 │ - │ - │ ARWX │ user1 │ 3d64ad0e-de83-4db9-8956-84a6a0f11d2f │
╰────────────────────────┴─────────────────────┴─────────────────────┴───────┴────────┴───────────────────────────────────┴──────────────────────────────────────╯
On Default Columns
Key | Description |
---|---|
Name | Package Name |
Version | Package Version |
Deployment Status | Indicates the overall state of the deployment |
Data | Indicates if the pacakge has associated data on disk |
Access | The level of access the requesting user has |
Owner Name | The User who pushed the package originally |
ID | Unique ID for the package |
It is also possible to list other entities in a package, such as pipeline
, database
, view
. The exhaustive list can be seen below in the kxi pm list --help
output.
Usage: kxi pm list [OPTIONS] [[package|deployment|pipeline|view|database|udf]]
List objects stored on kdb+ Insights Enterprise Package Manager service.
╭─ Authentication option overrides ────────────────────────────────────────────╮
│ --hostname,--url TEXT Insights URL │
│ --realm TEXT Realm │
│ --client-id TEXT Client id │
│ --client-secret TEXT Client secret │
│ --auth-enabled/--auth-disabled Retrieve Bearer Token │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --filter -f TEXT │
│ --fields TEXT [default: name, package, version, │
│ function, deployment.name, │
│ deployment.status, status, │
│ status.status, data, access, owner.name, │
│ id, manifest.version_info] │
│ --output-format -o [json|table] Output format for the list command │
│ --server-timeout TEXT Timeout for Insights server calls │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯