This commit is contained in:
Daniel Berteaud 2024-04-22 14:44:26 +02:00
parent a79eccc2f1
commit 5881f2330c
1 changed files with 5 additions and 10 deletions

View File

@ -6,11 +6,7 @@ job "[[ .instance ]]-brokers" {
group "broker" { group "broker" {
[[ $c := merge $c.broker $c ]] [[ $c := merge $c.broker $c ]]
[[ template "common/group_start" $c ]]
count = [[ $c.count ]]
shutdown_delay = "6s"
[[ template "common/constraints" $c ]]
network { network {
mode = "bridge" mode = "bridge"
@ -47,8 +43,8 @@ job "[[ .instance ]]-brokers" {
"-c", "-c",
"STATE=$(curl http://127.0.0.1:9404 | grep '^kafka_server_kafkaserver_brokerstate' | sed -r 's/.* (\\d+)\\.0/\\1/'); echo \"Broker state: ${STATE}\"; if [ \"${STATE}\" = \"3\" ]; then exit 0; else exit 1; fi" "STATE=$(curl http://127.0.0.1:9404 | grep '^kafka_server_kafkaserver_brokerstate' | sed -r 's/.* (\\d+)\\.0/\\1/'); echo \"Broker state: ${STATE}\"; if [ \"${STATE}\" = \"3\" ]; then exit 0; else exit 1; fi"
] ]
interval = "30s" interval = "[[ $c.consul.check.interval ]]"
timeout = "8s" timeout = "[[ $c.consul.check.timeout ]]"
task = "kafka-broker" task = "kafka-broker"
} }
@ -169,7 +165,7 @@ _EOT
} }
[[- if conv.ToBool $c.prometheus.enabled ]] [[- if conv.ToBool $c.prometheus.enabled ]]
[[- $c := merge .kafka.exporter $c ]] [[- $c := merge .kafka.exporter $c ]]
group "exporter" { group "exporter" {
network { network {
@ -189,8 +185,7 @@ _EOT
user = 9308 user = 9308
config { config {
image = "[[ $c.image ]]" [[ template "common/image" $c ]]
readonly_rootfs = true
pids_limit = 100 pids_limit = 100
command = "/local/kafka_exporter" command = "/local/kafka_exporter"
} }