Download Flexera Kubernetes Inventory Agent
The Flexera Kubernetes inventory agent is used to manage inventory collection within Kubernetes clusters. To deploy the Flexera Kubernetes inventory agent to one or more Kubernetes clusters requires that you make it available within the OCI container registry (the repository, or collection of repositories, used to store container images that comply with the Open Container Initiative.) In the following process, seek the assistance of your Kubernetes administrator(s).
As well, the infrastructure for FlexNet Manager Suite requires that, after installation, the Flexera Kubernetes inventory agent (and the FlexNet inventory agent, which may also be automatically deployed as a zero-footprint 'slave' to take inventory within containers) can upload inventory (.ndi) files to an inventory beacon. That inventory beacon must then be able to upload files to the central application server. Identify the URL of the inventory beacon to be used by the two agents in your (first) Kubernetes cluster, and keep the value ready for use in the following process.
To download and install the Flexera Kubernetes inventory agent:
-
Log on to a device that:
- Runs a supported version of Linux
- Has a web browser with network access to the web application server for FlexNet Manager Suite, where your account must have operator privileges to see the appropriate page
- Is a node within your [first] Kubernetes cluster
- Has a running instance of Docker
- Either hosts an OCI container registry, or has network access to an OCI container registry, that is available to your Kubernetes cluster.
Tip: This process is simplified if you log in to this device using an account that has administrative privileges for your OCI container registry (otherwise you need to hand off between separate accounts during the process). During installation, the account requires privileges to create the following resource types:Namespaces
ServiceAccounts
ClusterRoles
ClusterRoleBindings
Deployments
.
-
In your web browser, navigate in FlexNet Manager Suite to Discovery & Inventory > Settings.
The Inventory Settings page displays.
- Expand the Inventory agent for download section.
- Click Download Flexera Kubernetes inventory agent and save the downloaded archive file to a suitable location.
-
From the downloaded archive, extract the Flexera Kubernetes inventory agent image, for
example with the following command line (replacing the placeholder
x.y.z with the appropriate version numbers — at first
release, these are
1.0.0
):tar xzf flexera-krm-operator-x.y.z.tar.gz
Note: The version numbers in this command are the version numbers for the Flexera Kubernetes inventory agent you have downloaded, as shown in the name of the downloaded archive. Keep in mind that the downloaded image also includes the core inventory component of FlexNet inventory agent (ndtrack.sh), which has its own distinct version number — at this release, 16.5.0. By default, when the Flexera Kubernetes inventory agent pod is initially run on a Kubernetes node, it first asks its assigned inventory beacon for the latest policy about your settings in Discovery & Inventory > Settings > Inventory agent for automatic deployment > Version to deploy. If your selected version for FlexNet inventory agent does not match the one supplied in the downloaded image, the pod downloads the specified version, and subsequently uses that version of ndtrack.sh for collecting software inventory from other pods on the node. (If you do not want Flexera Kubernetes inventory agent to honor your settings in the web interface but instead use the version of ndtrack.sh included in the archived image you have just downloaded, ask your Kubernetes administrator to change the default value ofdownloadFromBeacon
, as described in Advanced Flexera Kubernetes inventory agent attributes.) -
Move into the directory that was extracted from the archive:
cd flexera-krm-operator-x.y.z
Tip: The extracted image includes the YAML configuration file and theinstall.sh
shell script needed later to install the resulting operator in a Kubernetes cluster. -
Import the extracted image into Docker:
docker load < flexera-krm-x.y.z.tar
-
Re-tag the image for your registry.
Tip: If you have multiple container registries, complete the process for each one, and then circle back to repeat the process from this point for the next registry.In these examples, the OCI container registry is shown as
images.example.com
, which you replace with the URL of your own registry.Important: The portion of the image nameflexera/krm
must not be changed. Simply prepend your registry URL in front of this string as shown.docker tag flexera/krm:x.y.z images.example.com/flexera/krm:x.y.z
- Ensure that you are logged into your OCI container registry, using an account with administrative privileges.
-
Push the image for Flexera Kubernetes inventory agent to your registry:
Only a single container image is required, as this is shared by the controller and all components of the Flexera Kubernetes inventory agent.docker push images.example.com/flexera/krm:x.y.z
Tip: Having the container image in the OCI container registry allows the controller to instantiate matching containers in the Kubernetes cluster. If, instead, the image has not been pushed to an accessible registry prior to installation, the controller pods will fail to deploy (at the end of this process). To remedy: If this failure happens, you can push the container image to the registry after the controller has been deployed. The pod will periodically attempt to pull the image again; or you can speed up the process by deleting the pod itself. TheReplicaSet
that manages the pod automatically re-creates the pod and immediately restarts the image pull process. -
Decide how you will provide persistent storage to the Flexera Kubernetes inventory agent.
The
StatefulSet
used by the Flexera Kubernetes inventory agent requires aPersistentVolumeClaim
(PVC) that defines its storage configuration. The storage requirements are:- The volume is durable/reliable across restarts and upgrades of the Kubernetes pods containing the Flexera Kubernetes inventory agent
- The volume is not shared with any other resources in the cluster
- A minimum of 2GB of storage is available
- The access mode must be
ReadWriteOnce
(this is the default for controllers) - The volume mode must be
Filesystem
(also the default for controllers).
-
From the expanded archive that you first downloaded, open the YAML file in your
preferred text editor and customize it for your environment.
The YAML file configures elements of your Kubernetes Resource Model (KRM). These values are read by the controller and used to correctly configure the Flexera Kubernetes inventory agent, both during initial deployment and whenever corrections to the running state are required. Most of the KRM values in the YAML file have intelligent defaults, so that only two changes are mandatory, as described here.Note: Currently, only a single KRM is supported for a given cluster. This means that, if you already have a KRM active within any cluster, you must merge the configuration details for Flexera Kubernetes inventory agent into your existing KRM, rather than simply updating the template YAML file included in the downloaded archive. For more information about the KRM structure and optional attributes, see Editing the Kubernetes Resource Model.The two mandatory changes are:
- The URL of the inventory beacon accessed by the two agents in this
Kubernetes cluster:
Attribute spec.monitor.beaconURL
Type String Example https://beacon.example.org
- The configuration you chose for the persistent storage for the Flexera Kubernetes inventory agent:
Attribute spec.monitor.storage
Type PersistentVolumeClaimSpec
Tip: If you have previously customized either the access mode or the volume mode, also restore the default values for these, as described above.When editing is complete, save the YAML file in place where it is accessed by the install script.
- The URL of the inventory beacon accessed by the two agents in this
Kubernetes cluster:
-
From the expanded archive that you first downloaded, open the
install.sh
script in your preferred text editor and customize it for your environment:The install script uses thekubectl
command to communicate with the Kubernetes cluster. Configurekubectl
correctly to connect to the correct cluster, using the appropriate account with cluster administrative privileges. For example:
This configureskubectl config set-context cluster-one --user=administrator
kubect1
such that subsequent commands (in particular, thekubectl apply
used by the installation script) refer to the cluster defined by thecluster-one
context, and use theadministrator
user.When the install script is run, it creates the operator for the Flexera Kubernetes inventory agent.Tip: In Kubernetes, an 'operator' means a controller that extends the Kubernetes API using custom resources to manage an application and its components.To do this, the install script creates the following resources in the Kubernetes cluster:- The krms.agents.flexera.com
CustomResourceDefinition
- The
flexera
Namespace
- A
ServiceAccount
in theflexera
Namespace
for the controller - A
ServiceAccount
in theflexera
Namespace
for the Flexera Kubernetes inventory agent - A
ClusterRole
that defines the permissions needed by the controller, and aClusterRoleBinding
to associate thatClusterRole
with the controller'sServiceAccount
- A
ClusterRole
that defines the permissions needed by the Flexera Kubernetes inventory agent ClusterRoleBindings
associating the agentClusterRole
and the built-in viewClusterRole
with the agent'sServiceAccount
- A
Deployment
of the controller application in theflexera
Namespace
.
- The krms.agents.flexera.com
-
Run the install.sh script with the appropriate parameters
(described here) to install the Kubernetes operator.
There is one mandatory parameter, and there are two conditional parameters, for the install script.
- Mandatory: The
--registry
option identifies your OCI container registry for this Kubernetes cluster, and causes the install script to update the YAML file by prepending the current registry to the container image specification (just as was done in the image import process, above). (Without this parameter given to the install script, later in the process, the controller pod fails to deploy.) Example command line, using the same placeholder as before:./install.sh --registry images.example.com
- Conditional: If you wish your Flexera Kubernetes inventory agent to
integrate with the IBM License Service, particularly for managing VPC
and PVU sub-capacity licensing for standalone products or bundles such
as IBM Cloud Paks, you must include the
--ibm-licensing
parameter. Cumulative example command line:./install.sh --registry images.example.com --ibm-licensing
- Conditional: If you wish your Flexera Kubernetes inventory agent to run on
the OpenShift platform (from Red Hat), you must include the
--openshift
parameter. On this platform, the container for Flexera Kubernetes inventory agent must be run as theroot
user, and this option creates an appropriateSecurityContextConstraints
entry and associates it with theServiceAccount
for the Flexera Kubernetes inventory agent. Cumulative example command line:./install.sh --registry images.example.com --ibm-licensing -–openshift
For more information, see the help provided with the installation script:
You may also see the README.md file included in the downloaded archive for the Flexera Kubernetes inventory agent../install.sh -–help
- Mandatory: The
FlexNet Manager Suite (On-Premises)
2021 R1