cs-codex-dist-tests/ProjectPlugins/MetricsPlugin/PrometheusContainerRecipe.cs

24 lines
716 B
C#
Raw Normal View History

2023-09-13 14:06:05 +00:00
using KubernetesWorkflow;
using KubernetesWorkflow.Recipe;
2023-09-13 09:25:08 +00:00
namespace MetricsPlugin
{
2023-09-13 14:06:05 +00:00
public class PrometheusContainerRecipe : ContainerRecipeFactory
2023-09-13 09:25:08 +00:00
{
public override string AppName => "prometheus";
public override string Image => "codexstorage/dist-tests-prometheus:latest";
2023-10-19 09:12:08 +00:00
public const string PortTag = "prometheus_port_tag";
2023-09-13 14:06:05 +00:00
protected override void Initialize(StartupConfig startupConfig)
2023-09-13 09:25:08 +00:00
{
var config = startupConfig.Get<PrometheusStartupConfig>();
SetSchedulingAffinity(notIn: "false");
2023-10-19 09:12:08 +00:00
AddExposedPortAndVar("PROM_PORT", PortTag);
2023-09-13 09:25:08 +00:00
AddEnvVar("PROM_CONFIG", config.PrometheusConfigBase64);
}
}
}