ServiceNow#
| Description | ServiceNow creates incidents from EDA query results. |
| Author | Nokia |
| Supported OS | N/A |
| Catalog | nokia-eda/catalog |
| Language | Go |
Overview#
The ServiceNow app connects EDA to a ServiceNow instance and creates incidents from matching EDA state.
It exposes four resources:
Instance: namespace-scoped connection details for a ServiceNow instance.Incident: namespace-scoped incident generator that references one or moreInstanceobjects.ClusterInstance: cluster-scoped connection details created in the EDA base namespace.ClusterIncident: cluster-scoped incident generator created in the EDA base namespace.
Installation#
Install the app from EDA Store or with kubectl:
Getting Started#
The setup has two steps:
- Create an
InstanceorClusterInstancethat can authenticate to ServiceNow. - Create an
IncidentorClusterIncidentthat references that instance and defines a query source.
Namespace behavior
Instance and Incident resources must be created outside the EDA base namespace. ClusterInstance and ClusterIncident resources must be created in the EDA base namespace.
ServiceNow Credentials Secret#
Each instance references a Kubernetes secret through spec.clientCredentials.
The secret must contain these keys:
client_idclient_secretusernamepassword
When the secret is referenced by name, the app looks for it in the namespace where Instance is defined. You can also refer to a secret by namespace/name to explicitly set the namespace the secret resides in.
Example credentials secret in namespace eda:
Instance Resource#
An instance defines how EDA connects to ServiceNow.
Important fields:
url: base URL of the ServiceNow instance.version: optional ServiceNow API version, for examplev2.clientCredentials: secret reference containing OAuth and user credentials.timeout,retryInterval,retryCount: request behavior for ServiceNow API calls.
After the resource is created, the controller continuously checks connectivity and updates:
status.reachablestatus.errorReasonstatus.lastChecked
Example namespace-scoped Instance:
Incident Resource#
An Incident or ClusterIncident subscribes to EDA state and creates incidents in all referenced ServiceNow instances.
Important fields:
enabled: whether the incident generator is active.instance: list of instance names to use as destinations.sources.query.table: the EDA table to watch.sources.query.where: filter applied to the subscription.sources.query.fields: optional list of fields to fetch. If omitted, all fields of the subscribed table are used.sources.query.autoResolve: resolves matching ServiceNow incidents when the object disappears.
The controller generates a deterministic correlation_id from the incident name and object path. When autoResolve is enabled, it looks up incidents with that correlation ID and updates them to a resolved state.
Query Templates#
The query source builds the ServiceNow incident body using Go templates. Common fields include:
shortDescriptiondescriptioncallerIdassignedToassignmentGroupstatepriorityurgencyimpactcategorysubCategorycloseCodecloseNotesresolutionCodecmdbcilocationcustomFields[]
Because many returned keys contain dots, index is usually the easiest way to reference them, for example {{ index . "node.name" }}.
For a namespace-scoped Incident, paths that start with .namespace are automatically rewritten so the subscription stays inside that namespace.
Example Incident:
apiVersion: snow.eda.nokia.com/v1alpha1
kind: Incident
metadata:
name: incident-sample
namespace: eda
spec:
description: Interface incident sample
enabled: true
instance:
- instance-sample
sources:
query:
table: .namespace.node.srl.interface
fields:
- oper-state
- admin-state
where: 'name = "ethernet-1/1" AND admin-state = "disable"'
autoResolve: true
shortDescription: '{{ index . "node.name" }}-{{ index . "interface.name" }}-{{ index . "oper-state" }}'
description: 'Interface {{ index . "interface.name" }} has oper-state {{ index . "oper-state" }} and admin-state {{ index . "admin-state" }} on node {{ index . "node.name" }}'
callerId: admin
assignedTo: Incident.Manager
assignmentGroup: Incident Management
state: "1"
priority: "1"
urgency: "1"
impact: "1"
category: Network
location: Sunnyvale, CA
customFields:
- name: field1
value: value1
- name: field2
value: value2
cat << 'EOF' | kubectl apply -f -
apiVersion: snow.eda.nokia.com/v1alpha1
kind: Incident
metadata:
name: incident-sample
namespace: eda
spec:
description: Interface incident sample
enabled: true
instance:
- instance-sample
sources:
query:
table: .namespace.node.srl.interface
fields:
- oper-state
- admin-state
where: 'name = "ethernet-1/1" AND admin-state = "disable"'
autoResolve: true
shortDescription: '{{ index . "node.name" }}-{{ index . "interface.name" }}-{{ index . "oper-state" }}'
description: 'Interface {{ index . "interface.name" }} has oper-state {{ index . "oper-state" }} and admin-state {{ index . "admin-state" }} on node {{ index . "node.name" }}'
callerId: admin
assignedTo: Incident.Manager
assignmentGroup: Incident Management
state: "1"
priority: "1"
urgency: "1"
impact: "1"
category: Network
location: Sunnyvale, CA
customFields:
- name: field1
value: value1
- name: field2
value: value2
EOF
Cluster-Scoped Resources#
Use ClusterInstance and ClusterIncident when you want to manage ServiceNow integration from the EDA base namespace.
The fields are the same as the namespace-scoped resources, but:
ClusterInstancemust exist in the EDA base namespace.ClusterIncidentreferencesClusterInstancenames.- Query subscriptions are not namespace-rewritten, so they can watch cross-namespace data.
Advanced Configuration#
The app installer exposes the following runtime settings:
snowCpuLimit: CPU limit for the controller.snowMemoryLimit: memory limit for the controller.snowProxyConfig: config map name used forHTTP_PROXY,HTTPS_PROXY, andNO_PROXY.
If you need a proxy, create or reuse a config map such as proxy-config in the EDA base namespace with those standard keys.