Download Flexera Kubernetes Inventory Agent

FlexNet Manager Suite 2021 R1 (On-Premises)

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:

  1. 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.
    The installation process creates the accounts and permissions needed for operation of the Flexera Kubernetes inventory agent and (when it is invoked to take inventory from within a container) ndtrack.sh.
  2. In your web browser, navigate in FlexNet Manager Suite to Discovery & Inventory > Settings.
    The Inventory Settings page displays.
  3. Expand the Inventory agent for download section.
  4. Click Download Flexera Kubernetes inventory agent and save the downloaded archive file to a suitable location.
  5. 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 of downloadFromBeacon, as described in Advanced Flexera Kubernetes inventory agent attributes.)
  6. 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 the install.sh shell script needed later to install the resulting operator in a Kubernetes cluster.
  7. Import the extracted image into Docker:
    docker load < flexera-krm-x.y.z.tar
  8. 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 name flexera/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
  9. Ensure that you are logged into your OCI container registry, using an account with administrative privileges.
  10. Push the image for Flexera Kubernetes inventory agent to your registry:
    docker push images.example.com/flexera/krm:x.y.z
    Only a single container image is required, as this is shared by the controller and all components of the Flexera Kubernetes inventory agent.
    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. The ReplicaSet that manages the pod automatically re-creates the pod and immediately restarts the image pull process.
  11. Decide how you will provide persistent storage to the Flexera Kubernetes inventory agent.
    The StatefulSet used by the Flexera Kubernetes inventory agent requires a PersistentVolumeClaim (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).
    Any configuration that meets these requirements is valid. You declare the result of your storage decision within the YAML file, next. For more information about specifying the persistent storage, see https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims.
  12. 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:
    1. 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
    2. 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.
  13. 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 the kubectl command to communicate with the Kubernetes cluster. Configure kubectl correctly to connect to the correct cluster, using the appropriate account with cluster administrative privileges. For example:
    kubectl config set-context cluster-one --user=administrator
    This configures kubect1 such that subsequent commands (in particular, the kubectl apply used by the installation script) refer to the cluster defined by the cluster-one context, and use the administrator 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:
    1. The krms.agents.flexera.com CustomResourceDefinition
    2. The flexera Namespace
    3. A ServiceAccount in the flexera Namespace for the controller
    4. A ServiceAccount in the flexera Namespace for the Flexera Kubernetes inventory agent
    5. A ClusterRole that defines the permissions needed by the controller, and a ClusterRoleBinding to associate that ClusterRole with the controller's ServiceAccount
    6. A ClusterRole that defines the permissions needed by the Flexera Kubernetes inventory agent
    7. ClusterRoleBindings associating the agent ClusterRole and the built-in view ClusterRole with the agent's ServiceAccount
    8. A Deployment of the controller application in the flexera Namespace.
  14. 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 the root user, and this option creates an appropriate SecurityContextConstraints entry and associates it with the ServiceAccount for the Flexera Kubernetes inventory agent. Cumulative example command line:
      ./install.sh --registry images.example.com --ibm-licensing -–openshift
    If your situation changes for this Kubernetes cluster, you may re-run the install script with the parameters that now apply. This overwrites your previous installation with one matching your new requirements.
    For more information, see the help provided with the installation script:
    ./install.sh -–help
    You may also see the README.md file included in the downloaded archive for the Flexera Kubernetes inventory agent.
When the install script indicates success, your Flexera Kubernetes inventory agent is installed and operational on this cluster, and the controller is initialized to maintain its desired state. For additional Kubernetes clusters, repeat this process, using modified parameters as appropriate to each one.

FlexNet Manager Suite (On-Premises)

2021 R1