[ci skip] add goflow2 netflow collector to monitoring module
This commit is contained in:
parent
9d52acd286
commit
bf3404bf6b
1 changed files with 98 additions and 0 deletions
98
stacks/platform/modules/monitoring/goflow2.tf
Normal file
98
stacks/platform/modules/monitoring/goflow2.tf
Normal file
|
|
@ -0,0 +1,98 @@
|
||||||
|
resource "kubernetes_deployment" "goflow2" {
|
||||||
|
metadata {
|
||||||
|
name = "goflow2"
|
||||||
|
namespace = kubernetes_namespace.monitoring.metadata[0].name
|
||||||
|
labels = {
|
||||||
|
app = "goflow2"
|
||||||
|
tier = var.tier
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spec {
|
||||||
|
replicas = 1
|
||||||
|
selector {
|
||||||
|
match_labels = {
|
||||||
|
app = "goflow2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
template {
|
||||||
|
metadata {
|
||||||
|
labels = {
|
||||||
|
app = "goflow2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spec {
|
||||||
|
container {
|
||||||
|
name = "goflow2"
|
||||||
|
image = "netsampler/goflow2:v2.2.1"
|
||||||
|
args = ["-listen", "netflow://:2055", "-transport", "stdout", "-format", "json"]
|
||||||
|
|
||||||
|
port {
|
||||||
|
name = "netflow"
|
||||||
|
container_port = 2055
|
||||||
|
protocol = "UDP"
|
||||||
|
}
|
||||||
|
port {
|
||||||
|
name = "metrics"
|
||||||
|
container_port = 8080
|
||||||
|
protocol = "TCP"
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
requests = {
|
||||||
|
cpu = "50m"
|
||||||
|
memory = "64Mi"
|
||||||
|
}
|
||||||
|
limits = {
|
||||||
|
cpu = "200m"
|
||||||
|
memory = "256Mi"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "kubernetes_service" "goflow2" {
|
||||||
|
metadata {
|
||||||
|
name = "goflow2"
|
||||||
|
namespace = kubernetes_namespace.monitoring.metadata[0].name
|
||||||
|
labels = {
|
||||||
|
app = "goflow2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spec {
|
||||||
|
selector = {
|
||||||
|
app = "goflow2"
|
||||||
|
}
|
||||||
|
port {
|
||||||
|
name = "metrics"
|
||||||
|
port = 8080
|
||||||
|
target_port = 8080
|
||||||
|
protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "kubernetes_service" "goflow2-netflow" {
|
||||||
|
metadata {
|
||||||
|
name = "goflow2-netflow"
|
||||||
|
namespace = kubernetes_namespace.monitoring.metadata[0].name
|
||||||
|
labels = {
|
||||||
|
app = "goflow2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spec {
|
||||||
|
type = "NodePort"
|
||||||
|
selector = {
|
||||||
|
app = "goflow2"
|
||||||
|
}
|
||||||
|
port {
|
||||||
|
name = "netflow"
|
||||||
|
port = 2055
|
||||||
|
target_port = 2055
|
||||||
|
protocol = "UDP"
|
||||||
|
node_port = 32055
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue