From babad3c4096d426247341d67248814b3cb353bf5 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Sun, 29 Sep 2024 19:44:08 +0100 Subject: [PATCH] Add metering to trustgraph-core component --- templates/components/trustgraph.jsonnet | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/templates/components/trustgraph.jsonnet b/templates/components/trustgraph.jsonnet index c7615ed4..b387f0d3 100644 --- a/templates/components/trustgraph.jsonnet +++ b/templates/components/trustgraph.jsonnet @@ -102,5 +102,35 @@ local prompt = import "prompt-template.jsonnet"; }, + "metering" +: { + + create:: function(engine) + + local container = + engine.container("metering") + .with_image(images.trustgraph) + .with_command([ + "metering", + "-p", + url.pulsar, + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "metering", [ container ] + ); + + local service = + engine.internalService(containerSet) + .with_port(8000, 8000, "metrics"); + + engine.resources([ + containerSet, + service, + ]) + + }, + } + prompt