Manual Installation
FlexNet Manager Suite ()
Manual installation of the Lightweight Kubernetes Inventory Agent is straight-forward: simply modify the YAML resources to suit your needs, and then apply them to the cluster.
Note: This process assumes that you have completed downloading and deploying the Lightweight Kubernetes Inventory Agent, as described in Downloading the Lightweight Kubernetes Agent.
This process requires the kubectl
tool installed on your working device.
-
To manually install the Lightweight Kubernetes Inventory Agent:
-
In your preferred flat text editor, update the
deployment.yaml
file as follows:Mandatory changes:
- Update the
image
setting in theDeployment
to specify the registry where you pushed the container image (for details, see Downloading the Lightweight Kubernetes Agent). In the following example, replace the placeholder registry.example.org with the URL of your own registry; and replace the placeholder a.b.c with the version number of the Lightweight Kubernetes Inventory Agent. - Set the
--beacon
flag to the URL of the inventory beacon to which the Lightweight Kubernetes Inventory Agent will upload its collected inventories (substituting your own value for the placeholder). - During operation of the Lightweight Kubernetes Inventory Agent, do you want it to expose Prometheus telemetry metrics so that you can monitor performance? If so, it is mandatory to set the
--metrics
flag in the YAML file, as shown in this example:
apiVersion: apps/v1
kind: Deployment
...
spec:
template:
spec:
containers:
- name: agent
image: *registry.example.org*/flexera/lwk:*a.b.c*
args:
- --beacon
- *https://beacon.example.org*
- --metricsNote: If the Lightweight Kubernetes Inventory Agent is to upload to the inventory beacon using the HTTPS protocol, communications must be secured with TLS. In this case, additional edits are required in the
deployment.yaml
file. For details, divert now to Managing Certificates for TLS, and return here after correctly configuring for the CA certificate bundle.Optional changes: Add any other configuration flags that you require to the
Deployment
in a similar fashion. These may be labels or annotations, security context configuration, or resource limits. For details of the options that can be specified as configuration flags, see Options for the Lightweight Kubernetes Agent.When your changes are complete, save the updated file in place.
- Update the
-
Apply the resources to the cluster, for example using the following command lines (which here include the optional extensions, discussed below):
cd install
kubectl apply -f namespace.yaml
kubectl apply -f rbac.yaml
kubectl apply -f deployment.yaml
kubectl apply -f extensions/prometheus-service.yaml
kubectl apply -f extensions/prometheus-servicemonitor.yaml
Very shortly, Kubernetes instantiates your container, and the Lightweight Kubernetes Inventory Agent immediately begins gathering inventory about the Node
, Namespace
, and Pod
resources in the cluster. By default, about 5 minutes later, the Lightweight Kubernetes Inventory Agent uploads the result to its nominated inventory beacon, by default to the path %CommonAppData%\Flexera Software\Incoming\Inventories
(notice that files do not stay long in this folder, but are uploaded to the parent device in the hierarchy of inventory beacons, or to the central application server, as appropriate; but perhaps the last modified time-stamp on that folder gives some indication of work in progress). The Lightweight Kubernetes Inventory Agent then waits for a default 24 hours before repeating the process. (Modify these default cycle timings with the ‑‑inventory-backoff
and ‑‑inventory-interval
options, as described in Options for the Lightweight Kubernetes Agent.)
Extensions
Extensions support optional features that need additional cluster permissions, or leverage third-party software that may (or may not) be installed in the cluster. They are defined by .yaml
files found in the install/extensions
subdirectory of the downloaded archive. Available extensions are:
-
ancestry
— For future expansion, and not currently supported in the web interface of FlexNet Manager Suite. As defined in theancestry.yaml
file, this:-
Creates a new
ClusterRole
namedflexera-lwk-ancestry
-
Uses a
ClusterRoleBinding
to bind that role to the service account running the Lightweight Kubernetes Inventory Agent.Tip: The service account called
lwk
is created in theflexera
namespace by either installation method (see the list of resources created in the cluster given in Downloading the Lightweight Kubernetes Agent).
The new role gives permission for the Lightweight Kubernetes Inventory Agent to read (using the
get
verb) additional resource types that are known to be part of the ownership hierarchy of aPod
, such as aReplicaSet
or aDeployment
, and to collect identifying information (name
,namespace
,UID
,type
.) It is not recommended that you enable this extension until there is support for displaying ancestry within the web interface. -
-
prometheus-service
— When its--metrics
flag is set, the Lightweight Kubernetes Inventory Agent supports exposing Prometheus metrics using an HTTP endpoint. You can create aService
to expose the metrics endpoint widely within the cluster, or outside of the cluster. Theprometheus-service
extension, defined in theprometheus-service.yaml
file, creates thisService
using values that are valid for the default configuration of the Lightweight Kubernetes Inventory Agent. If the--metrics
flag is not set, this extension is ignored.Tip: To set the
--metrics
flag, it must be included when invoking the install script for the Lightweight Kubernetes Inventory Agent (see example below). The install script appends the flag to theargs
attribute of the container for use by the Lightweight Kubernetes Inventory Agent. -
prometheus-servicemonitor
— When Prometheus is installed in the cluster usingprometheus-operator
(see https://github.com/prometheus-operator/prometheus-operator), and Prometheus metrics are enabled on the Lightweight Kubernetes Inventory Agent (that is, the--metrics
flag is set and theprometheus-service
extension is configured), theprometheus-servicemonitor
extension creates aServiceMonitor
, the custom resource type used byprometheus-operator
to automatically configure Prometheus to scrape a metrics endpoint. ThisServiceMonitor
allows Prometheus to automatically begin scraping metrics for the Lightweight Kubernetes Inventory Agent.Important: Use only in conjunction with the
prometheus-service
extension.
Parent topic:Downloading the Lightweight Kubernetes Agent