-
Notifications
You must be signed in to change notification settings - Fork 9
add healthcheck for disk usage with configurable thresholds #340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes update Kafka services by adding health check configurations in the Docker Compose file for three Kafka containers. Each container now runs a disk usage command at specified intervals, with settings for timeout, retries, and start period. Additionally, corresponding environment variables for disk usage thresholds are added to the package metadata, ensuring each Kafka service is evaluated against a defined threshold. Changes
Sequence Diagram(s)sequenceDiagram
participant Engine as Docker Engine
participant Kafka as Kafka Container
participant Cmd as Health Check Command
Engine->>Kafka: Trigger periodic health check
Kafka->>Cmd: Execute disk usage command (df bitnami/kafka -h ...)
Cmd-->>Kafka: Return disk usage percentage
Kafka->>Kafka: Compare result with env threshold
Kafka-->>Engine: Report healthy/unhealthy status
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
message-bus-kafka/docker-compose.cluster.kafka.yml (3)
11-16
: Healthcheck for kafka-01: Verify Command and Variable EscapingThe new healthcheck block for
kafka-01
is clear and well-structured. Please double-check that:
- The disk usage command (
df bitnami/kafka -h
) is targeting the correct mount (e.g. should it be/bitnami/kafka
?).- The use of double-dollar signs (e.g.
$$5
and$$1
) correctly escapes the shell variables in this YAML context so that they yield the expected values at runtime.- The environment variable
${KAFKA_01_DISK_USAGE_THRESHOLD}
is available in the container environment.
49-54
: Healthcheck for kafka-02: Consistency and Command ValidityThis healthcheck block mirrors the kafka-01 configuration with adjusted interval and timeout parameters. Ensure that:
- The command logic continues to correctly extract the disk usage percentage.
- The shell-escaped variables (e.g.
$$5
,$$1
) work as intended.- The
${KAFKA_02_DISK_USAGE_THRESHOLD}
variable is correctly injected into the container.
90-95
: Healthcheck for kafka-03: Confirm Execution LogicThe healthcheck for
kafka-03
is consistent with that of kafka-02. Please verify that:
- The healthcheck command is robust in extracting the disk usage percentage and comparing it to the threshold.
- The container correctly substitutes the environment variable
${KAFKA_03_DISK_USAGE_THRESHOLD}
.- Similar to the other services, the syntax (double-dollar usage) yields the correct runtime behavior.
message-bus-kafka/package-metadata.json (1)
32-34
: Disk Usage Threshold Environment Variables: Definition and Numeric ParsingThe addition of the three disk usage threshold variables (
KAFKA_01_DISK_USAGE_THRESHOLD
,KAFKA_02_DISK_USAGE_THRESHOLD
, andKAFKA_03_DISK_USAGE_THRESHOLD
) with a default value of"90"
is well implemented. A couple of points to consider:
- Confirm that these string values are interpreted numerically by the healthcheck commands (awk comparisons) in the containers.
- The integration of these variables into the existing configuration supports the health check functionality as expected.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
message-bus-kafka/docker-compose.cluster.kafka.yml
(3 hunks)message-bus-kafka/package-metadata.json
(1 hunks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary by CodeRabbit