mirror of
https://github.com/codex-storage/cs-codex-dist-tests.git
synced 2025-02-10 11:06:42 +00:00
initial setup of a grafana container
This commit is contained in:
parent
5d92b99926
commit
9037ddab6e
19
DistTestCore/Metrics/GrafanaContainerRecipe.cs
Normal file
19
DistTestCore/Metrics/GrafanaContainerRecipe.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using KubernetesWorkflow;
|
||||||
|
|
||||||
|
namespace DistTestCore.Metrics
|
||||||
|
{
|
||||||
|
public class GrafanaContainerRecipe : ContainerRecipeFactory
|
||||||
|
{
|
||||||
|
public override string AppName => "grafana";
|
||||||
|
public override string Image => "grafana/grafana-oss:10.0.3";
|
||||||
|
|
||||||
|
protected override void Initialize(StartupConfig startupConfig)
|
||||||
|
{
|
||||||
|
//var config = startupConfig.Get<PrometheusStartupConfig>();
|
||||||
|
|
||||||
|
//AddExposedPortAndVar("PROM_PORT");
|
||||||
|
AddExposedPort(3000);
|
||||||
|
//AddEnvVar("PROM_CONFIG", config.PrometheusConfigBase64);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -22,6 +22,10 @@ namespace DistTestCore
|
|||||||
var runningContainers = workflow.Start(1, Location.Unspecified, new PrometheusContainerRecipe(), startupConfig);
|
var runningContainers = workflow.Start(1, Location.Unspecified, new PrometheusContainerRecipe(), startupConfig);
|
||||||
if (runningContainers.Containers.Length != 1) throw new InvalidOperationException("Expected only 1 Prometheus container to be created.");
|
if (runningContainers.Containers.Length != 1) throw new InvalidOperationException("Expected only 1 Prometheus container to be created.");
|
||||||
|
|
||||||
|
workflow = lifecycle.WorkflowCreator.CreateWorkflow();
|
||||||
|
var grafanaContainers = workflow.Start(1, Location.Unspecified, new GrafanaContainerRecipe(), startupConfig);
|
||||||
|
if (grafanaContainers.Containers.Length != 1) throw new InvalidOperationException("should be 1");
|
||||||
|
|
||||||
LogEnd("Metrics server started.");
|
LogEnd("Metrics server started.");
|
||||||
|
|
||||||
return runningContainers;
|
return runningContainers;
|
||||||
|
@ -40,6 +40,13 @@
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Port AddExposedPort(int number, string tag = "")
|
||||||
|
{
|
||||||
|
var p = factory.CreatePort(number, tag);
|
||||||
|
exposedPorts.Add(p);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
protected Port AddInternalPort(string tag = "")
|
protected Port AddInternalPort(string tag = "")
|
||||||
{
|
{
|
||||||
var p = factory.CreatePort(tag);
|
var p = factory.CreatePort(tag);
|
||||||
|
@ -7,6 +7,11 @@ namespace KubernetesWorkflow
|
|||||||
{
|
{
|
||||||
private NumberSource portNumberSource = new NumberSource(8080);
|
private NumberSource portNumberSource = new NumberSource(8080);
|
||||||
|
|
||||||
|
public Port CreatePort(int number, string tag)
|
||||||
|
{
|
||||||
|
return new Port(number, tag);
|
||||||
|
}
|
||||||
|
|
||||||
public Port CreatePort(string tag)
|
public Port CreatePort(string tag)
|
||||||
{
|
{
|
||||||
return new Port(portNumberSource.GetNextNumber(), tag);
|
return new Port(portNumberSource.GetNextNumber(), tag);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user