Troubleshoot Kubernetes agent error: No IBM services found in namespace
The Flexera Kubernetes (KRM) agent integrates with IBM License Service to collect licensing data and incorporate it into inventory reporting. By combining IBM License Service data with information collected directly from the cluster, the KRM agent can provide a more detailed breakdown of licensing consumption, including which pods contributed to reported results.
If IBM Licensing is enabled for the KRM agent, you may see the following error when reviewing KRM monitor pod logs:
INFO -- ibm::setup: resolving license service config
WARNING -- ibm::config: the ibmlicensing did not have an instanceNamespace value, using the fallback default: ibm-common-services
WARNING -- ibm::config: no services found in namespace ibm-common-services matching labels app.kubernetes.io/component=ibm-licensing-service-svc,app.kubernetes.io/instance=ibm-licensing-service
ERROR -- ibm::setup: problem resolving license service config - error message: no services found
Possible causes
This issue can occur when:
- IBM License Service has not been installed in the cluster.
- IBM License Service is installed in a different namespace than the KRM agent expects.
Use the following steps to verify the namespace configuration used by IBM License Service and the KRM agent.
-
Run the following command:
kubectl get ibmlicensings.operator.ibm.com -o jsonReview the output under
specand look for theinstanceNamespacevalue. For example:"spec": { "apiSecretToken": "ibm-licensing-token", "datasource": "datacollector", "httpsEnable": true, "instanceNamespace": "ibm-licensing", "resources": {}, "version": "4.2.16" } -
Determine whether the
instanceNamespaceattribute is present.If
instanceNamespaceis present, verify that it matches the namespace where IBM License Service is installed.In some environments, the
instanceNamespaceattribute is missing. When this occurs, the KRM agent falls back to the default namespace:ibm-common-servicesIf IBM License Service is installed in a different namespace, the KRM agent will not be able to locate the service and the error will occur.
-
If IBM License Service is installed in a namespace other than
ibm-common-services, explicitly configure the namespace used by the KRM agent.For KRM agent deployments, update the KRM custom resource and reapply the configuration.
Example:
apiVersion: agents.flexera.com/v1 kind: KRM metadata: name: instance spec: ibmLicensing: enable: true namespace: my-ibm-namespace-example monitor: beaconURL: https://beacon.example.orgFor Helm chart deployments, add the following setting to your
values.yamlfile:ibmLicensing.namespace: "my-ibm-namespace-example" -
Reapply the updated configuration.
If the issue was caused by an incorrect namespace configuration, the KRM agent should be able to locate IBM License Service successfully.