Deploying assemblies
The kdb Insights Command Line Interface is used to deploy assemblies. Sample assemblies are available to download.
To manage assemblies, you must first configure the CLI to authenticate with the application. This involves:
- creating a service account and assigning the
insights.builder.*
role - configuring the CLI with the hostname, service account name and secret
To set up the CLI, use the kxi configure
command.
$ kxi configure
Hostname []: https://my-host.kx.com
Namespace []: test
Client ID []: my-publisher
Client Secret (input hidden):
Re-enter to confirm (input hidden):
CLI successfully configured, configuration stored in /~/.insights/cli-config
Deploying an assembly
To deploy an assembly, execute the following command:
kxi assembly deploy --filepath sdk_sample_assembly.yaml
Using assembly.filepath from command line option: sdk_sample_assembly.yaml
Submitting assembly from sdk_sample_assembly.yaml
Custom assembly resource sdk-sample-assembly created!
To update your assembly:
- Update your yaml file
- Teardown the assembly
- Redeploy the assembly
Teardown
You can stop an assembly using the teardown
command.
Note
This teardown process does not remove the persisted application data. These remain as Persisted Volumes (PVs) within the Kubernetes cluster.
kxi assembly teardown --name sdk-sample-assembly
Tearing down assembly sdk-sample-assembly
Are you sure you want to teardown sdk-sample-assembly [y/N]: y
After you have torn down a YAML assembly, it will be removed from the kxi assembly list
response.
You can also teardown UI-managed assemblies and this will flip their status.
The example below shows a YAML assembly being removed from the list
output.
kxi assembly list
ASSEMBLY NAME READY
dfx-assembly True
iot-assembly False
Redeploy
With the assembly torn down, the YAML file can me modified to reflect your desired changes.
For instance, reducing the size
of RDBs deployed from 3 replicas to 1 and increasing the RTLogVolume
to 40Gi.
vi sdk-sample-assembly
dap:
instances:
rdb:
mountName: rdb
source: south
rtLogVolume:
size: 40Gi
size: 1
Redeploy the new changes to the sdk_sample_assembly
kxi assembly deploy --filepath sdk_sample_assembly.yaml
Using assembly.filepath from command line option: sdk_sample_assembly.yaml
Submitting assembly from sdk_sample_assembly.yaml
Custom assembly resource sdk-sample-assembly created!
Assembly List
Once deployed, you may view all assemblies by running:
kxi assembly list
ASSEMBLY NAME READY
dfx-assembly True
iot-assembly False
sdk-sample-assembly True
Check assembly status
Assemblies may consist of a number of components. You can use the kxi assembly status
command
to check the status of the deployed components.
For a quick view of the created resources, get the assembly status:
kxi assembly status --name sdk-sample-assembly
{
"id": "",
"name": "sdk-sample-assembly",
"editable": false,
"running": true,
"ready": true,
"syncStatus": false,
"k8sStatus": [
{
"status": "True",
"type": "MountReady"
},
{
"lastTransitionTime": "2022-12-19T15:06:31Z",
"lastUpdateTime": "2022-12-19T15:06:31Z",
"status": "True",
"type": "StorageManagerReady"
},
{
"lastTransitionTime": "2022-12-19T15:06:24Z",
"lastUpdateTime": "2022-12-19T15:06:24Z",
"status": "True",
"type": "DataAccessReady"
},
{
"lastTransitionTime": "2022-12-19T15:06:52Z",
"lastUpdateTime": "2022-12-19T15:06:52Z",
"status": "True",
"type": "SequencerReady"
},
{
"lastTransitionTime": "2022-12-19T15:06:39Z",
"lastUpdateTime": "2022-12-19T15:06:39Z",
"status": "True",
"type": "PipelineReady"
},
{
"lastTransitionTime": "2022-12-19T15:06:24Z",
"lastUpdateTime": "2022-12-19T15:06:24Z",
"status": "True",
"type": "QueryEnvironmentReady"
},
{
"lastTransitionTime": "2022-12-19T15:06:52Z",
"lastUpdateTime": "2022-12-19T15:06:52Z",
"status": "True",
"type": "AssemblyReady"
}
]
}
Deploying assemblies to Kubernetes directly
When you deploy an assembly, the application deploys them to the Kubernetes control
plane where they are persisted. If there are issues managing assemblies through the
default CLI mode, you can interact with them directly in Kubernetes using the --use-kubeconfig
option.
This will communicate directly with the cluster and not via kdb Insights Enterprise.
with them by passing the --use-kubeconfig flag e.g. This mode should only be used as a fallback option.
This mode is not available if you deployed a kdb Insights Enterprise KX Managed Application from Azure Marketplace but you can contact Support for assistance.
kxi assembly deploy --filepath sdk_sample_assembly.yaml --use-kubeconfig
Kubernetes cluster access
This requires an active Kubernetes config (or kubeconfig) setup and authenticated.