-
Notifications
You must be signed in to change notification settings - Fork 735
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
Running Kafka Commands via kubectl exec, work around JMX_PORT conflict #144
Comments
I found that inconvenient too at first, after #96 was merged. However, I guess it's bad practice to start extra processes in these containers, in particular if you have memory limits or you monitor the resource footprint of kafka pods. The shell scripts that come with Kafka can run remotely. The kafka image has likely been pulled already to your nodes, så the following should be rather quick:
If your task needs more preparation I suggest an actual manifest. The example |
Thanks, but your suggestion would also require to actually run a shell script after first running bash. So not easy for automation tasks. But you gave me the idea to just run a new instance for the cmds. It's a docker container, so no big overhead, just run instead of bash the actual command. E.g.
Will test this later. |
One change, to have it execute in the namespace, but otherwise this works:
|
Is anyone executing commands against the cluster from shell scripts? I'm trying to run scripts for topic creation, disk space monitoring, etc. Directly running it from "kubectl exec" fails because of JMX_PORT conflict:
The workaround I use is to first bash into the machine and then run the cmds with the JMX_PORT env variable overwritten.
Unfortunately kubectl exec does not support providing environment variables.
Any ideas how to make this work without first running bash?
The text was updated successfully, but these errors were encountered: