Unable to perform Kubernetes Discovery on multiple Clusters

aliceal
Giga Guru

I'm hoping someone can help me out on this.

Following the Kubernetes discovery using patterns documentation, I have created a Discovery Schedule for each k8s Cluster we have.  I have created a unique Serverless Execution Pattern for each of those Discovery Schedules.

Items that are the same through each Pattern:
cluster_resource_id (blank)
cmdb_ci_kubernetes_cluster (blank)
credentialsAlias (The credentials I used to access the environment)
namespace (I want all the namespaces so I used *)
prometheusURL (blank)
provider (OnPrem)
url (The URL for our on prem Container solution)

Items that are unique for each Pattern:
cluster_name (name of the cluster I want to populate)

My current issue is that when I run the first Discovery Schedule, everything populates as expected.  But when I run the next one, it overwrites the name of the previous cluster, and doesn't populate the remaining tables (namespaces, ingress, workloads, etc.)

How am I supposed to populate multiple clusters?  

I tried adding the individual cluster_resource_id to each Pattern, but that didn't resolve the issue.



5 REPLIES 5

abbasshaik4
Tera Sage

Hello @aliceal,

 

Please refer to the link's below:

Kubernetes Discovery with ServiceNow - Complete Se... - ServiceNow Community

Kubernetes discovery using patterns • Brazil IT Operations Management • Docs | ServiceNow

 

If it is helpful, please mark it as helpful and accept the correct solution by referring to this solution in the future it will be helpful to them.

 

Thanks & Regards,

Abbas Shaik

aliceal
Giga Guru

Those were the links I had already used.  As I mentioned the initial Schedule works.  It's other clusters that don't and it simply overwrites the 1st Cluster.

AsaGamage
Tera Contributor

@alicealTry using a single Discovery Schedule and add a Serverless Execution Pattern for each cluster. For each cluster record, define only the required Discovery Pattern Launcher Parameters, such as url (clusterEndpoint), namespace (*), and credentialAlias. The remaining parameters are not required and can be removed.

Give it a try and let me know how it goes. 😊


That seems to be working.  I just moved all the Serverless Execution Patterns I had made over to the single Schedule and re-ran.  Thank you!