Skip to content
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

[bitnami/kafka] How to define healthcheck for kafka container #75323

Open
apachler opened this issue Dec 3, 2024 · 7 comments
Open

[bitnami/kafka] How to define healthcheck for kafka container #75323

apachler opened this issue Dec 3, 2024 · 7 comments

Comments

@apachler
Copy link

apachler commented Dec 3, 2024

Name and Version

bitnami/kafka:3.7

What is the problem this feature will solve?

I am using 3 instances of Kafka controlled by 3 instances of Zookeeper.

It seems the following healthcheck is not working if used in docker compose.

    healthcheck:
      test: ["CMD-SHELL", "kafka-topics.sh --list --bootstrap-server localhost:9092 || exit 1"]
      interval: 10s
      timeout: 30s
      retries: 10
      start_period: 30s

Since i am not very familiar with Kafka I just wanted to know what healthcheck command should be used.

What is the feature you are proposing to solve the problem?

Container image maintainers should provide a working healthcheck command.

@github-actions github-actions bot added the triage Triage is needed label Dec 3, 2024
@javsalgar
Copy link
Contributor

javsalgar commented Dec 3, 2024

Hi!

In the helm chart we have two checks:

liveness:

            exec:
              command:
                - pgrep
                - -f
                - kafka

readiness:

tcpSocket:
  port: client

So, for your case, you can try mimicking something similar in the container.

@javsalgar javsalgar changed the title How to define healthcheck for kafka container [bitnami/kafka] How to define healthcheck for kafka container Dec 3, 2024
@javsalgar javsalgar added the kafka label Dec 3, 2024
@apachler
Copy link
Author

apachler commented Dec 3, 2024

Is it really useful to check for a running process that is PID 1 ?
If PID 1 is not existing anymore the container would restart immediately. So this case is already catched.
Since i am not familiar with K8s i dont know what the readiness probe is doing exactly.

Something is really strange with Bitnami images because the initialization is not working/the container is not starting up if a HEALTHCHECK is enabled ...

@javsalgar
Copy link
Contributor

In the case of the readiness I imagine that it does some sort of operation close to a telnet or similar.

@apachler
Copy link
Author

apachler commented Dec 5, 2024

Hmmm, I think that just opening a connection to Kafka is not enough to make sure that the service is correctly working.

Anyways, as already discussed in #75322 - something is really wrong with the Bitnami images because activating the Docker healthcheck is killing the whole functionality of the container...

@github-actions github-actions bot removed the triage Triage is needed label Dec 11, 2024
@github-actions github-actions bot assigned alvneiayu and unassigned javsalgar Dec 11, 2024
@alvneiayu
Copy link
Contributor

hi @apachler

let me check it and investigate a little bit, I will come back as soon as possible with some info.

Thanks

@igloo12
Copy link

igloo12 commented Dec 19, 2024

I agree. My kafka pod is stuck where the readiness probe is failing, but the liveliness probe is okay.

@apachler
Copy link
Author

Maybe the issue is related to the complex initialization scripts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants