OBLYTECH Logo
OBLYTECH Logo

Kubernetes Cluster Discovery Setup

Kubernetes discovery in ServiceNow brings clusters, nodes, workloads, pods, containers, and images into the CMDB through Kubernetes patterns or Kubernetes Visibility Agent. Start by choosing the collection method, proving access to the cluster, and validating a small deployment. Then check relationships and ongoing updates before expanding discovery across your estate.

Choose the Kubernetes discovery route in ServiceNow

Use a cluster setup plan that distinguishes discovery access from CMDB acceptance. A connection can succeed while the resulting model still lacks the workloads or relationships your operations team needs. Write down the expected cluster, namespaces, sample deployment, pod, and container before changing configuration.

Pattern discovery uses a MID Server to reach the Kubernetes API. The Kubernetes pattern discovers infrastructure components, while the Kubernetes Event pattern collects changes. Kubernetes Visibility Agent (KVA) places an Informer in the cluster and streams resource changes to the instance. Choose the route your team can deploy, maintain, and validate.

For a broader explanation of identification and collection, see the ServiceNow Discovery guide. For this setup, keep acceptance focused on a cluster and its resources rather than treating a discovered cluster record as the finish line.

These steps match the ServiceNow Brazil release. Check them against your instance, installed applications, and release before you apply them. Record the Discovery and Service Mapping Patterns version or Informer version alongside the test results so later changes can be compared against a known starting point.

Prepare API access for pattern discovery

Deploy the current Discovery and Service Mapping Patterns application, identify the Kubernetes API endpoint, and verify that the selected MID Server can reach it. Use kubectl cluster-info to locate the endpoint and kubectl get namespaces to identify the namespaces to discover. Keep credentials out of shared test notes.

The Kubernetes identity needs GET access to the resource endpoints used by discovery. Check namespaces, services, pods, nodes, replication controllers, ingresses, deployments, StatefulSets, DaemonSets, ReplicaSets, CronJobs, and jobs. A successful request for pods does not prove that the same identity can read deployments or ingresses.

For namespace-scoped Role and RoleBinding configurations, check access in each namespace that discovery will enumerate. The per-namespace pattern uses the same resource permissions but lists resources within namespaces. Missing bindings can therefore leave a partial model even when another namespace is populated.

  1. Navigate to All > Discovery > Credentials, select New, and choose Kubernetes Credentials.
  2. Enter a descriptive Name and configure either User name and Password or Bearer Token Authentication with the Bearer Token field. Use one authentication method.
  3. Create or select the Credential alias used by the serverless schedule. For a new alias, set Type to Credential, save it, and associate it with the Kubernetes credential.

Automatic serverless Kubernetes schedules fetch the Bearer token without requiring separately added credentials. Establish whether you are using that cloud-driven route before building manual credential records and schedules for the same cluster.

Configure the cluster schedule and event collection

For a manually configured pattern route, open All > Discovery > Discovery Schedules and select New. Set Discover to Serverless and choose the MID Server selection method. Submit the schedule, then add an entry in Execution Patterns for Kubernetes or the supported large-cluster alternative.

Kubernetes Cluster – Per-Namespace LP is available from Discovery and Service Mapping Patterns version 1.35.1. It divides collection by namespace while populating the same CI data as the standard pattern. When choosing it, enable Run Child Patterns. Consider this route when a whole-cluster execution produces incomplete results on a large cluster.

In Pattern Launcher Parameters, configure url, namespace, credentials alias, cluster name, and provider for the target. The namespace value can contain a comma-separated selection including kube-system, or an asterisk for all namespaces. Use OnPrem for an on-premises deployment and the corresponding cloud provider value for cloud clusters.

The cluster name parameter uses the service account identifier followed by a space and the cluster name. Supply the appropriate cluster_resource_id for cloud deployments. Leave cluster_uid_cache empty when using the per-namespace pattern; it is an internal parameter.

Create a separate serverless schedule for Kubernetes Event collection, using the required cluster parameters and a five- or ten-minute interval. The first execution stores an event timestamp; subsequent executions collect changes after that timestamp. Validate a baseline discovery before relying on event collection to maintain it.

If pattern execution needs closer inspection, use the Pattern Designer authoring and validation guide to organize the investigation. Keep endpoint, credential, and namespace checks separate from changes to pattern logic.

Install the Informer when choosing Kubernetes Visibility Agent

The Informer can be installed with a Helm chart or the supplied Kubernetes YAML file. Installing the Informer does not require a specific ServiceNow role. Arrange the Kubernetes permissions needed to deploy the selected package with the cluster administrator rather than interpreting that role statement as unrestricted cluster access.

For Helm installation, prepare the target namespace, instance name, and cluster name. Set acceptEula to Y after reviewing the agreement. Configure image.repository and image.tag if deployment requires an organizational image repository, and proxyUrl if outgoing traffic uses a proxy. Set openShift to true for an OpenShift installation.

For YAML installation, extract k8s_informer.yaml, set ACCEPT_EULA to Y, replace the namespace and instance placeholders, and set CLUSTER_NAME to the cluster name as it appears in the CMDB. The instance placeholder takes the instance name without its domain. Apply the configured file with kubectl apply -f k8s_informer.yaml.

Where node taints prevent the Informer pod from being scheduled, supply the required tolerations through the Helm tolerations parameter. After deployment, check that the pod is scheduled and resource data reaches the instance. The Kubernetes Visibility Agent guide covers the agent route in more depth.

Validate containers and relationships in the CMDB

Inspect a known deployment from the cluster downward. Find its cluster, namespace, workload, pod, Docker Container, and Docker Image records. Compare those records with the sample selected before setup. Check both the resource identity and the relationship direction; a collection of disconnected records does not establish the expected topology.

  • Check cluster-to-node links using Cluster of::Cluster and cluster-to-pod links using Contains::Contained by.
  • For KVA, check namespace membership for a sample pod and the workload relationships that connect it to its owning deployment or controller.
  • Check the pod’s Contains::Contained by relationships to container and image records, then the image’s Instantiates::Instantiated by relationship to its container.
  • Check whether a missing relationship requires an optional setting before treating its absence as a collection failure.

With KVA, the pod-to-node Runs on::Runs relationship requires createPodNodeRelation.enable, which defaults to false. External node addresses, service addresses, and ingress addresses also have separate collection settings. Select these according to the topology you need rather than assuming the default graph contains them.

Record the accepted sample and any intentional omissions before expanding to additional clusters. For help planning this work, see ServiceNow implementation.

Test updates, troubleshoot gaps, and plan retirement

Use a controlled workload change to check ongoing collection after baseline acceptance. Record the change, its time, and the corresponding CMDB result. If the model stays unchanged, investigate the selected collection route, permissions, and resource scope before repeating a full estate discovery.

For pattern discovery, distinguish a REST response timeout from a Pattern Designer debugging timeout. The MID Server parameter mid.sa.cloud.request_timeout governs the former; sa.debugger.max_timeout governs the latter. Examine the failing operation and payload size before adjusting a timeout. The Discovery troubleshooting guide helps structure that evidence.

KVA cluster auto-retirement is disabled by default through sn_acc_visibility.auto_retire_k8s_clusters. When enabled, evaluation uses an Informer in the Down state and the cluster’s last update time during full discovery cycles. The default inactivity period is 60 days. Review associated-resource consequences before enabling it.

The default retirement value is 7, Retired. Choosing 100, Absent, makes the cluster and associated CIs subject to deletion by a table cleanup job. Treat that choice as a data lifecycle decision with an explicit review of what must remain available.

Questions about Kubernetes discovery setup choices

Can cloud discovery create cluster schedules automatically?

Yes. The AWS, Azure, and GCP cluster patterns collect cloud cluster information and create serverless schedules. When a cluster is deleted, its schedule becomes inactive. Check these generated schedules before adding another schedule manually.

Does discovering images guarantee container records?

No. From Patterns version 1.31.0, a configuration can collect Docker image CIs without Docker container CIs, subject to entitlement. Check that choice when image records appear but the expected container records do not. The sn_itom_pattern.bring_discovery_container system property determines whether collection includes both images and containers or images alone. Check entitlement for the 2026 Packaging SKU before planning to use image-only discovery.

Does service mesh discovery need additional components?

Yes. The pattern’s service mesh extension requires Istio and Prometheus configuration, including metrics collection. Kubernetes resource discovery alone does not establish service-to-service traffic relationships.

Can both Informer installation methods scan images with Syft?

Syft scanning is supported through the Helm installation method. It uses runSyftScanner set to true. Include the installation method in planning if software decomposition is part of the intended result.