mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-17 01:01:03 +02:00
Volumes
This commit is contained in:
parent
352627cd0f
commit
27e119f22e
2 changed files with 76 additions and 20 deletions
|
|
@ -18,7 +18,8 @@ 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 ]
|
||||||
|
|
@ -57,10 +58,11 @@ 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 ]
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
function(vol, mnt)
|
function(vol, mnt)
|
||||||
self + {
|
self + {
|
||||||
volumes: super.volumes + [{
|
volumes: super.volumes + [{
|
||||||
volume: vol.name, mount: mnt
|
volume: vol, mount: mnt
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -99,24 +99,32 @@
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
else {})
|
else {}) +
|
||||||
|
|
||||||
|
(if std.length(container.volumes) > 0 then
|
||||||
|
{
|
||||||
|
volumes: [
|
||||||
|
{
|
||||||
|
mountPath: vol.mount,
|
||||||
|
name: vol.volume.name,
|
||||||
|
}
|
||||||
|
for vol in container.volumes
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
],
|
||||||
|
volumes: [
|
||||||
|
vol.volume.volRef()
|
||||||
|
for vol in container.volumes
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
} + {}
|
} + {}
|
||||||
/*
|
|
||||||
|
|
||||||
|
|
||||||
(if std.length(container.volumes) > 0 then
|
|
||||||
{
|
|
||||||
volumes: [
|
|
||||||
"%s:%s" % [vol.volume, vol.mount]
|
|
||||||
for vol in container.volumes
|
|
||||||
]
|
|
||||||
}
|
|
||||||
else {})
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,9 +154,50 @@
|
||||||
with_size:: function(size) self + { size: size },
|
with_size:: function(size) self + { size: size },
|
||||||
|
|
||||||
add:: function() {
|
add:: function() {
|
||||||
volumes +: {
|
resources +: {
|
||||||
[volume.name]: {}
|
[volume.name + "-pv"]: {
|
||||||
|
apiVersion: "v1",
|
||||||
|
kind: "PersistentVolume",
|
||||||
|
metadata: {
|
||||||
|
name: volume.name,
|
||||||
|
labels: {
|
||||||
|
type: "local",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
spec: {
|
||||||
|
storageClassName: "manual",
|
||||||
|
capacity: {
|
||||||
|
storage: volume.size,
|
||||||
|
},
|
||||||
|
accessModes: [ "ReadWriteOnce" ],
|
||||||
|
hostPath: {
|
||||||
|
path: "/mnt/" + volume.name,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[volume.name + "-pvc"]: {
|
||||||
|
apiVersion: "v1",
|
||||||
|
kind: "PersistentVolumeClaim",
|
||||||
|
metadata: {
|
||||||
|
name: volume.name,
|
||||||
|
},
|
||||||
|
spec: {
|
||||||
|
storageClassName: "manual",
|
||||||
|
accessModes: [ "ReadWriteOnce" ],
|
||||||
|
resources: {
|
||||||
|
requests: {
|
||||||
|
storage: volume.size,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
volumeName: volume.name + "-pv",
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
volRef:: function() {
|
||||||
|
name: volume.name,
|
||||||
|
persistentVolumeClaim: { name: volume.name },
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
@ -164,6 +213,11 @@
|
||||||
with_size:: function(size) self + { size: size },
|
with_size:: function(size) self + { size: size },
|
||||||
|
|
||||||
add:: function() {
|
add:: function() {
|
||||||
|
},
|
||||||
|
|
||||||
|
volRef:: function() {
|
||||||
|
name: volume.name,
|
||||||
|
ASDpersistentVolumeClaim: { name: volume.name },
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue