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

how to config different configmap for different pod in one statefulset #37

Open
like-inspur opened this issue Nov 8, 2019 · 1 comment

Comments

@like-inspur
Copy link
Contributor

I want to inject configmap of telegraf for rabbbitmq cluster, and rabbitmq run in one statefulset with three replicas. And the need of monitor is config rabbitmq node self for rabbitmq pod like this:
[[inputs.rabbitmq]]
url = "http://172.16.1.26:15672"
username = "admin"
password = "QINtwo5P16SsCmPv"
header_timeout = "3s"
client_timeout = "4s"
nodes = ["rabbit@msg01"]
So how can I config for telegraf configmap of rabbitmq to achieve this need, when one pod of rabbitmq statefulset start, it config nodes with pod hostname for pod configmap thank you!

@byxorna
Copy link
Contributor

byxorna commented Nov 14, 2019

Hi @like-inspur. I do not quite follow the issue here. The k8s-sidecar-injector is responsible for adding containers, environment variables, and volumes into pods as they are being launched. Your described usecase does not seem like good fit for the sidecar injector, to be honest.

You might look into using k8s service discovery to have stable DNS name for your rabbitmq instance, and hardcode that into your config for telegraph.

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

No branches or pull requests

2 participants