Skip to content
68 changes: 68 additions & 0 deletions entity-types/infra-kubernetes_pod/tests/K8sPodSample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[
{
"agentName": "Infrastructure",
"agentVersion": "1.67.3",
"aws.arn": "arn:aws:ec2:us-east-1:123456789012:instance/i-0a1b2c3d4e5f67890",
"awsAccountId": "123456789012",
"awsAvailabilityZone": "us-east-1a",
"awsRegion": "us-east-1",
"cloudProvider": "aws",
"clusterName": "demo-cluster",
"containersReadyAt": 1770716166,
"coreCount": "16",
"createdAt": 1770716150,
"createdBy": "sample-app",
"createdKind": "Deployment",
"deploymentName": "sample-app",
"displayName": "sample-app-pod-abc12",
"ec2AmiId": "ami-0123456789abcdef0",
"entityGuid": "MXxJTkZSQXxOQXxFeGFtcGxlR3VpZA",
"entityId": "-1234567890123456789",
"entityKey": "k8s:demo-cluster:demo-namespace:pod:sample-app-pod-abc12",
"entityName": "k8s:demo-cluster:demo-namespace:pod:sample-app-pod-abc12",
"entityType": "KUBERNETES_POD",
"event_type": "K8sPodSample",
"externalKey": "k8s:demo-cluster:demo-namespace:pod:sample-app-pod-abc12",
"fullHostname": "ip-10-0-1-100.us-east-1.compute.internal",
"host": "ip-10-0-1-100.us-east-1.compute.internal",
"hostStatus": "running",
"hostname": "ip-10-0-1-100.us-east-1.compute.internal",
"initializedAt": 1770716154,
"instanceType": "m5.xlarge",
"integrationName": "com.newrelic.kubernetes",
"integrationVersion": "3.45.2",
"isReady": 1,
"isScheduled": 1,
"kernelVersion": "5.10.244-240.965.amzn2.x86_64",
"label.Name": "demo-cluster-node-pool-us-east-1a",
"label.app": "sample-app",
"label.department": "engineering",
"label.environment": "production",
"linuxDistribution": "Amazon Linux 2",
"namespace": "demo-namespace",
"namespaceName": "demo-namespace",
"net.errorsPerSecond": 0,
"net.rxBytesPerSecond": 0,
"net.txBytesPerSecond": 0,
"nodeIP": "10.0.1.100",
"nodeName": "ip-10-0-1-100.us-east-1.compute.internal",
"nr.cloudVmType": "AWS-EC2",
"nr.ingestTimeMs": 1773091680000,
"nr.invalidAttributeCount": 2,
"operatingSystem": "linux",
"podIP": "10.244.0.50",
"podName": "sample-app-pod-abc12",
"processorCount": "32",
"provider.awsAvailabilityZone": "us-east-1a",
"provider.awsRegion": "us-east-1",
"providerAccountId": "12345",
"providerAccountName": "demo-account",
"readyAt": 1770716166,
"reportingAgent": "i-0a1b2c3d4e5f67890",
"scheduledAt": 1770716154,
"startTime": 1770716154,
"status": "Running",
"systemMemoryBytes": "132914905088",
"timestamp": 1773091680000
}
]
4 changes: 1 addition & 3 deletions relationships/candidates/KUBERNETES_POD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ lookups:
onMultipleMatches: RELATE_ALL
onMiss:
action: NO_OP
- entityTypes:
- entityTypes:
- domain: INFRA
type: KUBERNETES_POD
tags:
matchingMode: ALL
predicates:
- tagKeys: ["k8s.namespaceName"]
field: k8s.namespace.name
- tagKeys: ["k8s.clusterName"]
field: k8s.cluster.name
- tagKeys: ["k8s.nodeName"]
Expand Down
30 changes: 15 additions & 15 deletions relationships/synthesis/INFRA-HOST-to-INFRA-KUBERNETES_POD.stg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ relationships:
expires: PT75M
relationshipType: HOSTS
source:
extractGuid:
attribute: host.guid
entityType:
value: HOST
lookupGuid:
candidateCategory: HOST
fields:
- field: hostName # hostname of host
attribute: nodeName # node hostname from pod
target:
extractGuid:
attribute: entityGuid
entityType:
value: KUBERNETES_POD
lookupGuid:
candidateCategory: KUBERNETES_POD
fields:
- field: k8s.cluster.name # cluster of pod
attribute: clusterName # cluster from K8sPodSample
- field: k8s.node.name # node of pod
attribute: nodeName # node from K8sPodSample
- name: otelKsmK8sHostHostsPod
# use kube-state-metrics system metric
version: "1"
Expand All @@ -40,20 +44,16 @@ relationships:
- attribute: k8s.cluster.name
present: true
relationship:
expires: PT2H
expires: PT75M
relationshipType: HOSTS
source:
extractGuid:
attribute: host.guid
entityType:
value: HOST
attribute: entity.guid
target:
lookupGuid:
candidateCategory: KUBERNETES_POD
fields:
- field: k8s.node.name # node name of host
attribute: host.name # node name of pod
- field: k8s.namespace.name # namespace of host
attribute: k8s.namespace.name # namespace of pod
attribute: host.name # hostname of pod
- field: k8s.cluster.name # cluster of host
attribute: k8s.cluster.name # cluster of pod