Added templates which produce K8s resources.  With the provided GCP wrapper, it works on GCP K8s cluster.  This isn't stable enough for other folks to use so will need more piloting before it can be documented and released.
This commit is contained in:
cybermaggedon 2024-09-07 18:59:38 +01:00 committed by GitHub
parent 7af32b0eef
commit f661791bbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 1037 additions and 345 deletions

View file

@ -7,19 +7,20 @@ local images = import "values/images.jsonnet";
create:: function(engine)
local confVolume = engine.volume("pulsar-conf").with_size("2G");
// local confVolume = engine.volume("pulsar-conf").with_size("2G");
local dataVolume = engine.volume("pulsar-data").with_size("20G");
local container =
engine.container("pulsar")
.with_image(images.pulsar)
.with_command("bin/pulsar standalone")
.with_command(["bin/pulsar", "standalone"])
// .with_command(["/bin/sh", "-c", "sleep 9999999"])
.with_environment({
"PULSAR_MEM": "-Xms700M -Xmx700M"
"PULSAR_MEM": "-Xms600M -Xmx600M"
})
.with_limits("1.0", "900M")
.with_reservations("0.5", "900M")
.with_volume_mount(confVolume, "/pulsar/conf")
.with_limits("2.0", "1500M")
.with_reservations("1.0", "1500M")
// .with_volume_mount(confVolume, "/pulsar/conf")
.with_volume_mount(dataVolume, "/pulsar/data")
.with_port(6650, 6650, "bookie")
.with_port(8080, 8080, "http");
@ -30,27 +31,35 @@ local images = import "values/images.jsonnet";
.with_command([
"sh",
"-c",
"pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response",
"while true; do pulsar-admin --admin-url http://pulsar:8080 tenants create tg ; pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow ; pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request ; pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response ; pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response; sleep 20; done",
])
.with_limits("0.5", "128M")
.with_reservations("0.1", "128M");
.with_limits("1", "400M")
.with_reservations("0.1", "400M");
local containerSet = engine.containers(
"pulsar",
[
container, adminContainer
container
]
);
local adminContainerSet = engine.containers(
"init-pulsar",
[
adminContainer
]
);
local service =
engine.service(containerSet)
.with_port(6650, 6650)
.with_port(8080, 8080);
.with_port(6650, 6650, "bookie")
.with_port(8080, 8080, "http");
engine.resources([
confVolume,
// confVolume,
dataVolume,
containerSet,
adminContainerSet,
service,
])
@ -58,5 +67,3 @@ local images = import "values/images.jsonnet";
}