2023-09-13 14:06:05 +00:00
|
|
|
|
using KubernetesWorkflow;
|
2023-11-12 09:07:23 +00:00
|
|
|
|
using KubernetesWorkflow.Recipe;
|
2023-09-11 09:59:33 +00:00
|
|
|
|
|
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-09-11 09:59:33 +00:00
|
|
|
|
|
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>();
|
2023-09-11 09:59:33 +00:00
|
|
|
|
|
2023-11-27 17:06:04 +00:00
|
|
|
|
SetSchedulingAffinity(notIn: "false");
|
2023-11-14 09:16:00 +00:00
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|