mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-19 10:11:01 +02:00
Configmap volume, just missing the file content
This commit is contained in:
parent
27e119f22e
commit
ae8b612b98
2 changed files with 33 additions and 18 deletions
|
|
@ -8,8 +8,9 @@ local images = import "values/images.jsonnet";
|
||||||
create:: function(engine)
|
create:: function(engine)
|
||||||
|
|
||||||
local vol = engine.volume("prometheus-data").with_size("20G");
|
local vol = engine.volume("prometheus-data").with_size("20G");
|
||||||
local cfgVol = engine.configVolume("./prometheus")
|
local cfgVol = engine.configVolume(
|
||||||
.with_size("20G");
|
"prometheus-cfg", "./prometheus"
|
||||||
|
);
|
||||||
|
|
||||||
local container =
|
local container =
|
||||||
engine.container("prometheus")
|
engine.container("prometheus")
|
||||||
|
|
@ -18,8 +19,7 @@ local images = import "values/images.jsonnet";
|
||||||
.with_reservations("0.1", "128M")
|
.with_reservations("0.1", "128M")
|
||||||
.with_port(9090, 9090, "http")
|
.with_port(9090, 9090, "http")
|
||||||
.with_volume_mount(cfgVol, "/etc/prometheus")
|
.with_volume_mount(cfgVol, "/etc/prometheus")
|
||||||
.with_volume_mount(vol, "/prometheus")
|
.with_volume_mount(vol, "/prometheus");
|
||||||
;
|
|
||||||
|
|
||||||
local containerSet = engine.containers(
|
local containerSet = engine.containers(
|
||||||
"prometheus", [ container ]
|
"prometheus", [ container ]
|
||||||
|
|
@ -38,12 +38,15 @@ local images = import "values/images.jsonnet";
|
||||||
create:: function(engine)
|
create:: function(engine)
|
||||||
|
|
||||||
local vol = engine.volume("grafana-storage").with_size("20G");
|
local vol = engine.volume("grafana-storage").with_size("20G");
|
||||||
local cv1 = engine.configVolume("./grafana/dashboard.yml")
|
local cv1 = engine.configVolume(
|
||||||
.with_size("20G");
|
"dashboard-yml", "./grafana/dashboard.yml"
|
||||||
local cv2 = engine.configVolume("./grafana/datasource.yml")
|
);
|
||||||
.with_size("20G");
|
local cv2 = engine.configVolume(
|
||||||
local cv3 = engine.configVolume("./grafana/dashboard.json")
|
"datasource-yml", "./grafana/datasource.yml"
|
||||||
.with_size("20G");
|
);
|
||||||
|
local cv3 = engine.configVolume(
|
||||||
|
"dashboard-json", "./grafana/dashboard.json"
|
||||||
|
);
|
||||||
|
|
||||||
local container =
|
local container =
|
||||||
engine.container("grafana")
|
engine.container("grafana")
|
||||||
|
|
@ -58,11 +61,10 @@ local images = import "values/images.jsonnet";
|
||||||
.with_limits("1.0", "256M")
|
.with_limits("1.0", "256M")
|
||||||
.with_reservations("0.5", "256M")
|
.with_reservations("0.5", "256M")
|
||||||
.with_port(3000, 3000, "cassandra")
|
.with_port(3000, 3000, "cassandra")
|
||||||
// .with_volume_mount(vol, "/var/lib/grafana")
|
.with_volume_mount(vol, "/var/lib/grafana")
|
||||||
// .with_volume_mount(cv1, "/etc/grafana/provisioning/dashboards/dashboard.yml")
|
.with_volume_mount(cv1, "/etc/grafana/provisioning/dashboards/dashboard.yml")
|
||||||
// .with_volume_mount(cv2, "/etc/grafana/provisioning/datasources/datasource.yml")
|
.with_volume_mount(cv2, "/etc/grafana/provisioning/datasources/datasource.yml")
|
||||||
// .with_volume_mount(cv3, "/var/lib/grafana/dashboards/dashboard.json")
|
.with_volume_mount(cv3, "/var/lib/grafana/dashboards/dashboard.json");
|
||||||
;
|
|
||||||
|
|
||||||
local containerSet = engine.containers(
|
local containerSet = engine.containers(
|
||||||
"grafana", [ container ]
|
"grafana", [ container ]
|
||||||
|
|
|
||||||
|
|
@ -197,13 +197,13 @@
|
||||||
|
|
||||||
volRef:: function() {
|
volRef:: function() {
|
||||||
name: volume.name,
|
name: volume.name,
|
||||||
persistentVolumeClaim: { name: volume.name },
|
persistentVolumeClaim: { name: volume.name + "-pvc" },
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: For K8s
|
// FIXME: For K8s
|
||||||
configVolume:: function(name)
|
configVolume:: function(name, dir)
|
||||||
{
|
{
|
||||||
|
|
||||||
local volume = self,
|
local volume = self,
|
||||||
|
|
@ -213,11 +213,24 @@
|
||||||
with_size:: function(size) self + { size: size },
|
with_size:: function(size) self + { size: size },
|
||||||
|
|
||||||
add:: function() {
|
add:: function() {
|
||||||
|
resources +: {
|
||||||
|
[volume.name + "-cm"]: {
|
||||||
|
apiVersion: "v1",
|
||||||
|
kind: "ConfigMap",
|
||||||
|
metadata: {
|
||||||
|
name: volume.name,
|
||||||
|
namespace: "trustgraph",
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
thing: "asldkajsdj"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
volRef:: function() {
|
volRef:: function() {
|
||||||
name: volume.name,
|
name: volume.name,
|
||||||
ASDpersistentVolumeClaim: { name: volume.name },
|
configMap: { name: volume.name + "-cm" },
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue