Skip to content

Commit

Permalink
Kubernetes: node autodiscover, add InternalIP (elastic#15930)
Browse files Browse the repository at this point in the history
* use any node ip
  • Loading branch information
Pablo Mercado authored Jan 31, 2020
1 parent 2cde4ce commit 6273589
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libbeat/autodiscover/providers/kubernetes/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ func (n *node) emit(node *kubernetes.Node, flag string) {
},
}
n.publish(event)

}

func getAddress(node *kubernetes.Node) string {
Expand All @@ -198,6 +197,12 @@ func getAddress(node *kubernetes.Node) string {
}
}

for _, address := range node.Status.Addresses {
if address.Type == v1.NodeInternalIP && address.Address != "" {
return address.Address
}
}

return ""
}

Expand Down

0 comments on commit 6273589

Please sign in to comment.