Skip to content

Commit

Permalink
feat(kafka): Added readiness probe
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexnortung committed Nov 15, 2024
1 parent bc867b7 commit 1ba9070
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
6 changes: 6 additions & 0 deletions src/modules/services/kafka-connect.nix
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ in
port = "8083";
};
};

depends_on = {
kafka = {
condition = "process_healthy";
};
};
};
};

Expand Down
26 changes: 10 additions & 16 deletions src/modules/services/kafka.nix
Original file line number Diff line number Diff line change
Expand Up @@ -225,22 +225,16 @@ in
processes.kafka = {
exec = "${startKafka}/bin/start-kafka";

# process-compose = {
# readiness_probe = {
# # exec.command = "${pkgs.curl}/bin/curl -f -k http://localhost:9092/topics";
# http_get = {
# host = "localhost";
# scheme = "http";
# path = "/topics";
# port = 9092;
# };
# initial_delay_seconds = 5;
# period_seconds = 10;
# timeout_seconds = 5;
# success_threshold = 1;
# failure_threshold = 3;
# };
# };
process-compose = {
readiness_probe = {
exec.command = "${cfg.package}/bin/kafka-topics.sh --list --bootstrap-server localhost:9092";
initial_delay_seconds = 5;
period_seconds = 10;
timeout_seconds = 5;
success_threshold = 1;
failure_threshold = 3;
};
};
};
})
];
Expand Down

0 comments on commit 1ba9070

Please sign in to comment.